#2 — GZip compression of Javascript Registry cachekey not working

by Max Bloechle last modified Jul 16, 2012 09:44 AM
State Unconfirmed
Version:
Area Functionality
Issue type Bug
Severity Medium
Submitted by Max Bloechle
Submitted on Mar 22, 2011
Responsible
Target release:
GZip compression works well for css and html objects but not for the merged javascript cachekey. This is unfortunate, since it allows a nice size reduction from 132kb out of the box down to 44kb with working compression theoretically.

I found out, that unchecking "Merging allowed" for jquery.js in registry will result in gzip compression for jquery-integration-cachekeyxxxx.js (all other js files) but still no gzip compression for jquery-cachekeyxxxx.js. Gzip compression will be enabled for jquery-cachekeyxxxx.js only when "compression type" is set from none to either safe-encoding or full-encoding. That however is no option since it will break jquery functionality. When "Content-Encoding gzip" is working a "Vary Accept-Encoding" is added.

Enabling caching after importing the "Without caching proxy" profile does not change behaviour but adds "X-Cache-Rule plone.stableResource" and "X-Cache-Operation plone.app.caching.strongCaching" as expected.

Searching the web I found that jquery is commonly compressed. I am missing the expertise to fix this in plone. Perhaps you can give me a hint? Am I missing something? I am testing with Firefox 3.6 and firebug 1.6.2. under Linux without any apache etc in front as non-authenticated user.
Steps to reproduce:
buildout: eggs = plone.app.caching; extends = http://good-py.appspot.com/release/plone.app.caching/1.0b1, run buildout.
Add Plone Site. Install HTTP caching support 1.0b1.
In @@caching-controlpanel activate gzip compression.
Check jquery-cachekeyxxxx.js headers for "Content-Encoding gzip" and "Vary Accept-Encoding": none, size 132kb.
Added by Marco Celotti on Oct 28, 2011 10:45 AM
It might be something related to file size (>64KB).
Are smaller js gzipped?
Added by Max Bloechle on Nov 25, 2011 10:09 PM
Yes, testing in the latest plone 4.1.2 confirms your suggestion. It seems to be related to the uncompressed composed javascript registry file size beeing bigger than something like 64kB. If a fragmented composite is forced by unchecking the merge option of jquery, smaller files are compressed while jquery with some 78kB+ will remain uncompressed.

Any ideas from where this limitation comes from? Is this an issue of plone.app.caching or not?
Added by Max Bloechle on Jan 24, 2012 06:35 PM
I found that the bug is still valid but becomes of lesser importance since in most setups zope is operated behind a cache. In my case zope is behind an Apache cache that properly compresses files larger than 64kB.
Added by Manuel Amador (Rudd-O) on Jul 16, 2012 09:44 AM
Can you please fix this bug? Many sites are behind Varnish, and Varnish does not have (and does not plan to implement) the capacity to gzip-compress received files (for good reason). The retor "ah, but Apache can do it" is not a valid response to this real and tangible need. The file is HUGE, and there are real wins to be gotten with compression, especially for mobile devices.

Thanks in advance.

No responses can be added.