Welcome! Log In Create A New Profile

Advanced

Re: Proxy_cache_key based on custom header

Francis Daly
June 30, 2017 12:28PM
On Tue, Jun 27, 2017 at 05:43:22PM -0400, deivid__ wrote:

Hi there,

You will probably change your setup so that the default proxy_cache_key
works for you; but for information:

> If `proxy_cache` is set to `$sent_http_x_test_header`:
> - Every request gets cached (good)
> - All URLs map to the same cache (very bad!)
> - I don't get the 'X-Banana' header at all

The only useful content of proxy_cache_key is things that are known
*before* the matching proxy_pass request would be made. (Otherwise,
there is no way that a second request could be served from the cache,
avoiding the upstream connection.)

So $sent_* and $upstream_* variables should not be used, since they will
be empty.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy_cache_key based on custom header

deivid__ June 27, 2017 05:43PM

Re: Proxy_cache_key based on custom header

Francis Daly June 30, 2017 12:28PM

Re: Proxy_cache_key based on custom header

pbooth June 30, 2017 01:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready