Problem with cache key
Francis Daly
francis at daoine.org
Mon Oct 24 17:02:51 UTC 2016
On Wed, Oct 19, 2016 at 06:05:54AM -0400, CarstenK. wrote:
Hi there,
> I took a look at the header nginx response.
> Vary: Accept-Encoding
> Vary: Accept-Encoding
So they both vary based on Accept-Encoding.
When I do a quick test of my versions of curl, Chrome, and Firefox,
I see no Accept-Encoding header for curl, "gzip, deflate, sdch, br"
for Chrome, and "gzip, deflate" for Firefox.
Those are three different values, and upstream presumably says that the
response depends on the value, so the cached version for one should not
be returned in response to another.
> How can i have a look for the headers of upstream servers?
>From nginx to upstream - you could check the nginx debug log (I think),
or the upstream log, or possibly "tcpdump" the traffic to see what
exactly is happening.
In this case, it is probably the client request to nginx that is showing
the different headers. For that, you could check the nginx debug log,
or "tcpdump" that traffic.
There is a now-parallel thread at
https://forum.nginx.org/read.php?2,270496,270510 which shows a way to
"normalise" the Accept-Encoding headers that are sent to upstream. That
would be at the cost of (e.g.) not being able to serve sdch- or br-encoded
content to the Chrome that asked for it.
Cheers,
f
--
Francis Daly francis at daoine.org
More information about the nginx
mailing list