Welcome! Log In Create A New Profile

Advanced

Re: Problem with cache key

Francis Daly
October 18, 2016 03:14PM
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 http://nginx.org/r/proxy_ignore_headers,

> 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.

Cheers,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problem with cache key

CarstenK. October 17, 2016 09:50AM

Re: Problem with cache key

Francis Daly October 18, 2016 03:14PM

Re: Problem with cache key

CarstenK. October 19, 2016 06:05AM

Re: Problem with cache key

Francis Daly October 24, 2016 01:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 75
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready