Problem with cache key

Francis Daly francis at
Tue Oct 18 19:12:40 UTC 2016

On Mon, Oct 17, 2016 at 09:50:15AM -0400, CarstenK. wrote:

Hi there,

> If i send a request to url A with Chrom and another request with curl or
> firefox i have a cache miss. 
> If isend a request to the same url with curl on two different machines the
> answer is a cache hit, thats fine. 

If you look at the request from nginx to upstream, and the response from
upstream to nginx, can you see the headers?

Particularly the Vary: header of the response -- often it will include
"User-Agent", which would explain what you see.

If that is the issue, and you know that upstream sends the same content
to all user-agents, then you can configure nginx so that that piece is
not used in nginx's decision to cache.

According to,

> proxy_ignore_headers X-Accel-Expires Expires Cache-Control; 

"Vary" is the most likely of the fields that you could ignore that you
do not.


Francis Daly        francis at

More information about the nginx mailing list