Avoid cache on zero-bytes-returned?

AJ Weber aweber at comcast.net
Wed Mar 13 15:02:32 UTC 2013



On 3/13/2013 10:40 AM, Jonathan Matthews wrote:
>
> It looks to me like
> http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_no_cache
> is what you need to use.
> If the backend is returning a Content-Length header, you could refer
> to that. If not, you may have to get creative in assembling a map{}
> variable.
I looked at that, but it appears that it only tests for the existence of 
the variable/header.  Content-Length should be there all the time.
>
> FWIW, a 200 with an empty body is, (I believe) invalid. It should be a
> 204. If your backend is misbehaving, you might like to fix it before
> mitigating the problem inside your reverse-proxy. Remember: broken
> gets fixed, but shitty lives forever ...
>
I tend to agree with you here.  Sometimes you can't open-up the 
application code very easily...but it's a very fair and valid point.  
I'll look into it.

Thanks for the reply,
AJ



More information about the nginx mailing list