Adding compression to Apache
Posted: Sun Jun 17, 2007 3:14 pm
I'd like add compression to my website. However, after doing some preliminary research, I have come out being more confused than when I started.
I have a specific set of requirements:
1. The method must work with Apache 2. This rules out mod_gzip for my shared servers setup.
2. The server must not compress the file each time it is requested. This is extremely wasteful and most of my content is static. It appears mod_gzip has the ability to do this, but due to requirement one I cannot do use it. mod_deflate does not appear to be able to do this (and its compression level is specifically set lower by default to compensate)
3. The compression must be done in a cross-browser compatible way to ensure minimal breakage if a browser is known not to handle gzipped content correctly. It appears this document would be helpful in implementing this. Also, a previous forum member has posted on this topic and mentioned a specific set of mod_rewrite rules that are a very practical implementation of the rules.
From these three requirements, it looks like I will have to forgo any compression module and hand-compress the files myself, in a manner similar to Arawn's solution. I'd like to field the question to you guys, however, if there is a better way (i.e. needs less work) of achieving the same functionality?
I have a specific set of requirements:
1. The method must work with Apache 2. This rules out mod_gzip for my shared servers setup.
2. The server must not compress the file each time it is requested. This is extremely wasteful and most of my content is static. It appears mod_gzip has the ability to do this, but due to requirement one I cannot do use it. mod_deflate does not appear to be able to do this (and its compression level is specifically set lower by default to compensate)
3. The compression must be done in a cross-browser compatible way to ensure minimal breakage if a browser is known not to handle gzipped content correctly. It appears this document would be helpful in implementing this. Also, a previous forum member has posted on this topic and mentioned a specific set of mod_rewrite rules that are a very practical implementation of the rules.
From these three requirements, it looks like I will have to forgo any compression module and hand-compress the files myself, in a manner similar to Arawn's solution. I'd like to field the question to you guys, however, if there is a better way (i.e. needs less work) of achieving the same functionality?