How to configure gzip on Apache so that static files (for example, js) once compressed, cached and distributed from the cache.
1 answer
Cache - do you mean mod_cache ? For example:
<IfModule mod_cache.c> CacheLock on CacheLockPath /tmp/mod_cache-lock CacheLockMaxAge 5</IfModule> With gzip is about the same. Or maybe something from this does not work?
That's what is available in the online documentation here uses mod_deflate, as far as I understood gzip is nothing to do with
<Location />SetOutputFilter DEFLATEBrowserMatch ^Mozilla/4 gzip-only-text/htmlBrowserMatch ^Mozilla/4\.0[678] no-gzipBrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html# Don't compress imagesSetEnvIfNoCase Request_URI \\.(?:gif|jpe?g|png)$ no-gzip dont-varyHeader append Vary User-Agent env=!dont-vary</Location> - I would like to see this with an example. The main thing you want to avoid is not to compress the files yourself, but let it be done automatically. Judging by the documentation, mod_gzip has the option mod_gzip_can_negotiate, which says that if for example there is an interface.js.gz file, then return it instead of interface. jsBut for this to work, you need to prepare these gz files yourself. Maybe there is a solution that stings and caches static files at the same time? - eurobax
- apache on yunikha? - e_klimin
|