Summary: | Minify JavaScript and CSS | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Installation and upgrade (web-based installer) | Assignee: | Dobrica Pavlinusic <dpavlin> |
Status: | CLOSED WONTFIX | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | CC: | chris, cnighswonger, dcook, dpavlin, jonathan.druart, nick, oleonard |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7906 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19474 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20427 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 1918 - Minify JavaScript and CSS
Bug 1918 - Minify JavaScript and CSS |
Description
Chris Cormack
2010-05-21 00:36:07 UTC
I would like to address this one as part of performance work. I found https://github.com/jshirley/Plack-Middleware-ComboLoader which got me pushed in right direction, but in the end I decided to implement Koha::Template::Plugin::Combine because it turned out that it's easier if we can use combining and minification together. Changes are available at: https://github.com/dpavlin/Koha/compare/dpavlin:plack...dpavlin:bug_1918-combine Minification alone doesn't buy us much: OPAC search: minify js 334974 -> 311553 93.01% minify css 148277 -> 133128 89.78% intranet search: minify js 382102 -> 362172 94.78% minify css 134754 -> 123771 91.85% But combining JS and CSS files together saves us round-trips to server: OPAC 32 -> 20 requests intranet 27 -> 13 requests I would love to hear your feedback on this. This seems to be related to the loading sequence of css and js we were discussing on irc the other day. I opened bug 7906 for it which may be a duplicate of this one. I think any performance improvements should be pushed forward. Created attachment 9112 [details] [review] Bug 1918 - Minify JavaScript and CSS This provides new Koha::Template::Plugin::Combine which is intended to replace direct include of JavaScript and CSS files. This plugin preserves order of included files when combining them. Code need cleanup and documentation, but attaching it to bug will provide easier way to try it out. Created attachment 9917 [details] [review] Bug 1918 - Minify JavaScript and CSS Rebased patch. I test for curiosity :) For testing, install libjavascript-minifier-xs-perl and libcss-minifier-xs-perl. You need to create a koha-tmpl/intranet-tmpl/prog/en/combined directory with write mode for www-data Feedback: With firebug, I see 2 errors on the intranet detail page: GET menu-button-arrow.png 404 Not Found GET sprite.png 404 Not Found detail.pl: 21 requests 165.2 KB (159 KB from cache) 2.41s (onload: 2.5s) vs 9 requests 158.9 KB (146.2 KB from cache) 2.66s (121.8 KB JS + 24.3 KB CSS) search.pl (results): 20 requests 167.8 KB (159 KB from cache) 1.6s (onload: 3.68s) vs 4 requests 158.2 KB (146.2 KB from cache) 4.04s (onload: 4.05s) (121.8 KB JS + 24.3 KB CSS) We observe a decrease of the number of requests and data size, but also a small increase of the load time. I don't know if you have checked the load time. I did not test with Plack ! Thanks for rebase, I don't think this patch is really ready for sign-off so I'm changing status of this bug. I will need to investigate increase for on-load time, but since we are executing extra code to produce combined files, and emitting larger CSS and JavaScript files I would expect a small difference. For one thing, it still has warn(s) in it, so RM will fail QA on it, and on the other there are a few references to Koha::Persistant which is my internal thingy to track usage and should be replaced with Koha::Cache code in future. Any progress here? We have moved towards having a build process for client-side assets with the introduction of SCSS, so I'm inclined to mark this "WONTFIX." (In reply to Owen Leonard from comment #7) > We have moved towards having a build process for client-side assets with the > introduction of SCSS, so I'm inclined to mark this "WONTFIX." +1 |