Custom response codes and content-types for memcache module

Chancey chanceycn at
Tue Jul 22 14:15:56 MSD 2008

Very interesting !



发件人: M. Van der klip 
发送时间: 2008-07-22  17:57:37 
收件人: nginx at 
主题: Custom response codes and content-types for memcache module 

I have recently written a patch which allows storage of custom HTTP
response codes and Content-type headers within memcache alongside the
actual response body. This allows us to pass the not_found's of the
memcache module to a PHP script which can serve and store different
kinds of responses in the cache.

The chosen approach is quite rough for this first version. The memcache
module is able to interpret two special commands prepended to the
response body.

This example serves a custom 404 page from memcached:

^SET-STATUS:404 Not Found| <HTML > <BODY >...

This example serves /sitemap.xml from memcached:

^SET-CONTENT-TYPE:application/xml; charset=UTF8| <?xml version="1.0"
encoding="UTF-8" ? > <urlset...

Please let me know if there is any interest in this patch. If so, I
could make it available. Without any warranties ofcourse. :P
Posted via
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list