Is is possible to compress/gzip the cached files managed via nginx fastcgi_cache? I am thinking of saving two versions of cached files (normal & compressed) and use appropriate key structure to deliver the best suited version. This way we can save time + CPU when delivering compressed files.
Asked
Active
Viewed 909 times
1 Answers
1
You can't control the storage inside the Nginx FastCGI cache, but if you enable Gzip compression, Nginx will deliver the pages compressed to client.

Mark Stosberg
- 3,901
- 24
- 28
-
1I agree, if Gzip is on, nginx will deliver compressed pages to the clients. But under the hood, nginx will first get the uncompressed page from the cache, then compress it and deliver it for every request, so I was hoping to find a way to remove the compressing task from the middle, so we has to compress the output once, and serve it to multiple request. And we also keep an uncompressed copy for those clients which don't support the compression. It does increase the cache size, but decrease the tasks. – firex Feb 04 '16 at 20:35
-
Have you looked at the cache files to confirm if they are compressed inside the cache? The documentation doesn't specify a storage format for the cache. – Mark Stosberg Feb 04 '16 at 21:49