Enable mod_gip in Apache 1.3 (12th June 2011)

After much fruitless searching I eventually found this copy-and-paste mod_gzip example. Phew! Now I can verify that my stylesheet is Gzip compressed. Older but wiser…I just took a few lines from it:

# Try getting mod_gzip to compress stylesheets:
# http://www.techiepark.com/tutorials/how-to-enable-gzip-compression-in-apache-server-to-speed-up-website/
<IfModule mod_gzip.c>
 mod_gzip_on Yes
 mod_gzip_dechunk Yes
 mod_gzip_item_include file \.(x?html?|txt|css|js|php)$
 mod_gzip_item_include mime ^text/.*

It is enabled for .htm and .html static files by using a question mark in the Regular Expression. I also added .xhtml support the same way. (Yes, I did need to search. But that’s the site I always use for newbie RegEx questions.)