combining and minification of javascript and css
I would like to address this one as part of performance work. We have existing bug for this, but I'm sending also this to list to get wider feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1918 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-com... 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. -- Dobrica Pavlinusic 2share!2flame dpavlin@rot13.org Unix addict. Internet consultant. http://www.rot13.org/~dpavlin
I think it's a good idea to do as a plugin since then it is not plack only. Another easy win is to set some expires headers so browsers cache better. Chris -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Dobrica Pavlinusic <dpavlin@rot13.org> wrote: I would like to address this one as part of performance work. We have existing bug for this, but I'm sending also this to list to get wider feedback. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1918 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-com... 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. -- Dobrica Pavlinusic 2share!2flame dpavlin@rot13.org Unix addict. Internet consultant. http://www.rot13.org/~dpavlin _____________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
On Sat, Apr 7, 2012 at 6:02 PM, Dobrica Pavlinusic <dpavlin@rot13.org>wrote:
I would like to address this one as part of performance work.
We have existing bug for this, but I'm sending also this to list to get wider feedback.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=1918
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-com...
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 sounds like a discussion we had on irc the other day which resulted in bug 7906. I'll try to carve out a few moments to test this out on Monday. Kind Regards, Chris
participants (3)
-
Chris Cormack -
Chris Nighswonger -
Dobrica Pavlinusic