views:

23

answers:

1

Hello!

When using Gzip to compress css and js files, does the compressed css or js file remain cached in the server to be resent to other visitors or does it require another compression process for each visitor or even each page view?

thanks.

+1  A: 

The old Apache 1.3 series had options:

mod_gzip_can_negotiate Yes
mod_gzip_static_suffix .gz
AddEncoding gzip .gz
mod_gzip_update_static Yes

to do so, but Apache 2's mod_deflate apparently does not (http://thinkvitamin.com/code/serving-javascript-fast/). Either way, caching the compressed version of files is not the default. In particular, the 1.3 series would inefficiently create and delete a temp file for each request.

If you're using Apache 2 and you want to pre-compress your CSS and JS to reduce CPU load, your question has already been answered on Server Fault: http://serverfault.com/questions/131452/apache2-mod-deflate-static-content

idealmachine