Modify

Opened 2 years ago

Closed 7 months ago

#9764 closed enhancement (fixed)

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

Reported by: rjollos Owned by: rjollos
Priority: normal Component: QuietPlugin
Severity: normal Keywords: pull-request
Cc: hasienda Trac Release: 0.11

Description (last modified by rjollos)

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 rjollos 2 years ago.
QuietFromCache.png (19.4 KB) - added by anonymous 2 years ago.

Download all attachments as: .zip

Change History (9)

Changed 2 years ago by rjollos

comment:1 Changed 2 years ago by rjollos

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

Changed 2 years ago by anonymous

comment:2 Changed 2 years ago by rjollos

  • Cc hasienda added

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 2 years ago by rjollos

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

comment:4 Changed 2 years ago by rjollos

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 7 months ago by rjollos

  • Owner changed from robguttman to rjollos
  • Status changed from new to accepted

comment:6 Changed 7 months ago by rjollos

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 7 months ago by rjollos

  • Resolution set to fixed
  • Status changed from accepted to closed

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.