I'm running nginx on a cheap VPS, which has pretty horrible disk i/o. As such I keep most of my content in memcached so that nginx never has to hit the disk, a good mix of cached dynamic and cached static content. I wanted to use GZIP compression without wasting CPU cycles gzipping memcached content over and over again.<div>
<br></div><div>I created a flag "memcache_assume_gzipped" to the memcache module. If you turn it on for a location, it will append "Content-type: gzip" to the headers of the response inside the memcache module. This way, you can gzip content (level 9), store it straight into memcache, and then nginx will return it with the appropriate headers. Example here:</div>
<div><br></div><div><a href="http://alpha.criticalmeltdown.com/demo/2">http://alpha.criticalmeltdown.com/demo/2</a></div><div><br></div><div>Is this something anyone is interested in incorporating into the current stable branch, or is it too much of a niche need? If anyone wants it, I can throw together a patch file.</div>
<div><br></div><div>Thanks,</div><div>Dan</div>