Custom response codes and content-types for memcache module

Spil Games lists at ruby-forum.com
Tue Aug 26 18:08:59 MSD 2008


Spil Games wrote:
> What about the 404 vs 503 thing? Do you have any opinions what would be 
> the best way to solve this? Making the status code for a not_found 
> configurable should not be too hard, but I'd like to know if you think 
> that's the way to go forward.


I've spend some more time on this today and have found that making the 
response code configurable it not so easy as it seems, because some 404 
stuff is hardcoded in the upstream module.

Then I did some experiments with setting and checking a 
$memcached_not_found variable, but that failed too because I could not 
make Nginx execute the memcached stuff first and check the variable 
afterwards.

Another thought is to disable error_pages completely when serving a 
succesful hit from the memcached module. As a quick hack I tried this:

  /* disable error pages */
  clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
  clcf->error_pages = NULL;

That works, but disables error_pages permanently. I have no idea how to 
do something like this only temporarily (for the current request).

Any ideas? Or should I just release the current memcache patch with the 
503 stuff removed? Ofcourse I'd still be using the 503 stuff internally 
as an its-a-hack-but-it-works (TM) thing. ;-)
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list