Welcome! Log In Create A New Profile

Advanced

Re: Question about proxy_cache_key

Francis Daly
February 16, 2017 07:42AM
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
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Question about proxy_cache_key

dewanggaba February 16, 2017 01:10AM

Re: Question about proxy_cache_key

dewanggaba February 16, 2017 02:00AM

Re: Question about proxy_cache_key

Francis Daly February 16, 2017 07:42AM

Re: Question about proxy_cache_key

dewanggaba February 19, 2017 02:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready