proxy_cache incorrectly returning 304 Not Modified

Jon Leighton j at
Fri Jan 10 16:37:14 UTC 2014


On 10/01/14 16:06, Maxim Dounin wrote:
> Note though that nginx doesn't understand "Vary: Accept-Encoding",
> and will return cached response regardless of client's 
> Accept-Encoding.  To make sure gzipped responses aren't sent to 
> clients without gzip support you should either disable caching of 
> such responses, or switch off gzip of your backend (e.g., with 
> "proxy_set_header Accept-Encoding '';"), or switch on gunzip in 
> nginx (

Thanks, this is the conclusion I came to also. Also I agree about
Pingdom probably just not making it clear that the response was all binary.

I am hopefully going to solve it by putting the compression method
(based on Accept-Encoding) in the cache key. Not sure if the 304 issue
will come back but it's a step in the right direction at least.


More information about the nginx mailing list