Modify

Opened 12 years ago

Closed 10 years ago

#9764 closed enhancement (fixed)

[Patch] Replace template with javascript function to improve page load time

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: QuietPlugin
Severity: normal Keywords: pull-request
Cc: Steffen Hoffmann Trac Release: 0.11

Description (last modified by Ryan J Ollos)

I've done some work over in #7617 with help from hasienda to improve the page load times when using the DateFieldPlugin. We replaced a virtual script (template) with a script and used add_script_data that is available now in Trac 0.12 to pass data to the script. The result is (and I barely know what I'm talking about here), the js file is under chrome and is treated as a cacheable static resource, resulting in improved page load times. I put a lot of info in #7617, documenting the improvements that I saw.

I'm thinking the same is probably possible here. By replacing the quiet.html with quiet.js and adding using add_script, it will get located under chrome and cached in the browser.

Attachments (2)

QuietPlugin.png (42.9 KB) - added by Ryan J Ollos 12 years ago.
QuietFromCache.png (19.4 KB) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (9)

Changed 12 years ago by Ryan J Ollos

Attachment: QuietPlugin.png added

comment:1 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)
Keywords: pull-request added
Summary: Replace template with javascript function to improve page load time[Patch] Replace template with javascript function to improve page load time

Changed 12 years ago by anonymous

Attachment: QuietFromCache.png added

comment:2 Changed 12 years ago by Ryan J Ollos

Cc: Steffen Hoffmann added; anonymous removed

I've created a patch and pushed it to my development fork on BitBucket: 610ad703cf2f. I'm not an expert at interpreting the profiling results that I posted, but it seems like this change has improved page load times since the JS is cached and we've removed the template that seems to be loaded every time.

comment:3 Changed 12 years ago by Ryan J Ollos

If you apply the patch, make sure to clear your browser cache to prior to doing any testing.

comment:4 Changed 12 years ago by Ryan J Ollos

I've been running this patch now for 5 months with now issues, with the exception of #9748, which existed prior to the patch.

comment:5 Changed 10 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newaccepted

comment:6 Changed 10 years ago by Ryan J Ollos

In 13537:

1.0.1: Replace virtual script with a script and use add_script_data to pass data to the script. Refs #9764.

comment:7 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.