I am serving all content through apache with Content-Encoding: zip
but that compresses on the fly. A good amount of my content is static files on the disk. I want to gzip the files beforehand rather than compressing them every time they are requested.
This is something that, I believe, mod_gzip
did in Apache 1.x automatically, but just having the file with .gz next to it. That's no longer the case with mod_deflate
.
I have a lot of big .json files. Most readers are in this situation. The preview answers didn't talk about the returned "Content-type".
I you want the following request return a pre-compressed file with "Content-Type: application/json" transparently, use Multiview with ForceType
1) files must be rename: "file.ext.ext"
2) Multiview works great with ForceType
In the file system:
In your apache config:
Short and simple :)
You can use
mod_cache
to proxy local content in memory or on disk. I don't know if this will work as expected withmod_deflate
.