
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] Testing Apache for gzip modules
Pier, JC, dikshie,
Thank you for responding.
Using the methods you suggest, I have confirmed that my Apache server
(2.2.14) does not have mod_gzip installed. It does have mod_expires, though.
My server is Red Hat Enterprise Linux AS release 4 (Nahant Update 3),
which puts me a little at a disadvantage, because my usual bread and
butter is Ubuntu, which is debian based.
I'm also confused a little because the line between mod_gzip and
mod_deflate is a little blurry. Some pages I've read seem to indicate
they're the same thing, or at least that if you have mod_deflate that it
supports gzip as well. Which should I be getting?
Apparently, if my server were on Debian, I could just say "a2enmod
deflate" and be up and running. However, for Red Hat, I'm told I need to
edit httpd.conf to have the line:
LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
... but I'm sceptical of that. Will it just work to add the line? Don't
I need to install anything?
Any advice would be much appreciated.
Also, I should probably mention the .htaccess code I'm using in
combination with the Apache modules in order to get compression and
expires turned on. I got it off the net after looking at a few different
variants. Hopefully this .htaccess code is not problematic:
# BEGIN Compress text files
<IfModule mod_deflate.c>
<FilesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# END Compress text files
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
<FilesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</FilesMatch>
<FilesMatch "\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# BEGIN Turn ETags Off
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
# END Turn ETags Off
# BEGIN Remove Last-Modified Header
<IfModule mod_headers.c>
Header unset Last-Modified
</IfModule>
# END Remove Last-Modified Header
--
Dave M G
Home |
Main Index |
Thread Index