Question about proxy_cache_key
Dewangga Bachrul Alam
dewanggaba at xtremenitro.org
Sun Feb 19 19:44:54 UTC 2017
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello!
Thanks Francis, yes it's about 'Vary' header should be ignored on
proxy_ignore_headers.
Thanks for the hints.
On 02/16/2017 07:41 PM, Francis Daly wrote:
> On Thu, Feb 16, 2017 at 01:08:35PM +0700, Dewangga Bachrul Alam
> wrote:
>
> Hi there,
>
>> proxy_cache_key "$uri$is_args$args";
>>
>> location / { proxy_ignore_headers Cache-Control Expires
>> Set-Cookie; rewrite (?<capt>.*) $capt?$args&view=$mobile break;
>> }
>
>> My question is, the URI
>> https://subdomain.domain.tld/artikel/berita/a-pen-by-hair
>> accessed from another browser (eg. Safari) and cache status was
>> HIT, then I tried to invoke `PURGE` command from shell using
>> cURL, it was failed and return cache_key not found
>
> I do not know the "fix"; but I suspect that the *reason* is due to
> the Vary header that is sent in the response.
>
> If you know that "Vary" is not relevant in your case, then
> possibly temporarily adding it to proxy_ignore_headers will let you
> see whether that is related.
>
>> The following argument "&view=desktop?" should be follow. Is
>> there any hints to match the proxy_cache_key? So I can purge the
>> cache anywhere and anytime?
>
> I guess that the "view=desktop" part comes from your rewrite
> directive; it may take more documentation-digging to find the
> actual cache key that is used internally in nginx, so that the
> purge facility can work with it.
>
> (Or possibly the ngx_cache_purge module could be updated to work
> transparently with the current nginx cache key behaviour -- I do
> not know whether that is possible.)
>
> Good luck with it,
>
> f
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQI4BAEBCAAiBQJYqfWuGxxkZXdhbmdnYWJhQHh0cmVtZW5pdHJvLm9yZwAKCRDl
f9IgoCjNcL1wD/42wuifFcihgZPlvjL0r1B7BcFrH8E42EixXt3X7mC6pcz+Rp+6
Pu+b3Rk6MV9HMO5mZKsIkGiYdQfxY3y8jqwXPMrCSprg7sOVI5mm8AA+sAaRMjkW
gOdgOK422bWO3aQI11pVCrd1YSoFh6dCNMp6NnBpp/Keml59gQioBBW4jNO2Mp2p
I1vOzIZlyCKPH5Oa6ZsR6GkHf5ZzocVZH9QyeZV+2DVK3KZVUIATmzjVVXIWeaPn
dqVVv74Bok7bUTPEktimo3pFzIL6EsG6EIOffCAb9xt2EN0avtPFmcnNK/gUX6sm
tBFq2mBBS7MKlS7C5mrujF5KYm6kHA8l1Bv7NMrjX9KiTYk8YRin/dkbXYnwxxZz
GedU69c4LULjwuVI4/sUGoYQY3tblstMMLmsF67INgG+wtyeN6uAYD6BRdBoaWGA
jz72PPICq0vRLuTMyBtSQ+1XmL7OP5UUSOONpEabE/07PfoBivh/8nwfxVqGdpeP
yvVpgJe15hmuNr9UMyLKgVtagLI3xXfkBLdezkv6F+mG4gClt6a/Dxmz/Wm/8v+E
rwILgD35lSu0JnuCxqIlo5F4Xamf2EhqcPG5L7Zs5KK4tq7RDUNfLyeIe74HbjUw
v8BDrRnQXPYHaug+e7tztF4N71nfu4epArAs7cqK8ybckCGvtQTdMmsg/A==
=I/z8
-----END PGP SIGNATURE-----
More information about the nginx
mailing list