Item730: Foswiki.org webserver should use gzip/deflate compression to reduce page load times
Priority: Low
Current State: Closed
Released In:
Target Release: n/a
Applies To: Web Site
Component:
Branches:
Safari Network Timeline reveals that your webserver is not enabling compression (e.g. gzip/deflate) for .js files.
Examples:
- foswiki.org/pub/System/BehaviorContrib/behaviour.compressed.js (Note compressed in this filename means js compressed, not transmission compressed)
- foswiki.org/pub/System/JavascriptFiles/foswikilib.js
- foswiki.org/pub/System/JavascriptFiles/foswikiWindow.js
- foswiki.org/pub/System/JavascriptFiles/foswikiEvent.js
- foswiki.org/pub/System/JavascriptFiles/foswikiHTML.js
- ...
- foswiki.org/pub/System/PatternSkin/pattern.js
Page load times would improve if you did.
--
TimotheLitt - 10 Jan 2009
Make the item
SMART (updated title).
--
ArthurClemens - 07 Feb 2009
Since this has hung around for a while without any action, here is the standard formula for apache:
LoadModule deflate_module modules/mod_deflate.so
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
--
TimotheLitt - 07 Feb 2009
I had tested this before, and it seemed to have worked.
Anyway, problem here was that I assumed javascript would be either
text/javascript
or
application/x-javascript
where in fact it is
application/javascript
I've fixed the apache configuration, and restarted it.
Thanks Timothe for reporting it, and Arthur for making me aware of this issue by assigning it to me.
Timothe, just so you know, I usually use that to compress output:
# This compresses responses using gzip
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/css text/javascript application/x-javascript application/javascript
So doing it the other way around. You compress everything but what's not in a list, I compress just what I want to be compressed. Details, but might be useful to someone.
--
OlivierRaginel - 08 Feb 2009