views:

596

answers:

3

It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep wishing?

+1  A: 

Hm, I think mod_cache will do the job. http://httpd.apache.org/docs/2.0/mod/mod_cache.html

Node
A: 
orlandu63
+3  A: 

If you want a quick and lazy solution, just make gzipped copies of your most used files and turn MultiViews on for them. This still has CPU overhead to calculate the right file to send but it's less than a gzip every time. If you want to take it further you can create static type-map files.

Also you could consider using Lighttpd if possible instead of Apache. It has a mod_compress which does exactly what you want.

Ant P.