Welcome! Log In Create A New Profile

Advanced

Re: 2 locations, 2 _different_ cache valid settings, but same cache & pass-through

Francis Daly
March 27, 2020 04:24AM
On Tue, Mar 24, 2020 at 11:15:59PM +0000, randyorbs wrote:

Hi there,

> 4. use _different_ cache valid settings...
> location /foo {
> proxy_pass "http://myhost.io/go";
> proxy_cache shared_cache;
> proxy_cache_valid any 5m;
> }
> location /bar {
> proxy_pass "http://myhost.io/go";
> proxy_cache shared_cache;
> proxy_cache_valid any 10m;
> }
>
> What I have found is that I can request /foo, then /bar and the /bar result will be an immediate HIT on the cache, which is good - the keys are the same and they are both aware of the cache. However, now that I've requested /bar any requests to /foo will result in cache HITs for 10 minutes instead of the 5 minutes I want. If I never hit /bar, then /foo will cache HIT for the correct 5 minutes.
>
> Any thoughts on how I can use NGINX to configure my way into a solution for my unusual (?) use-case?

The nginx cache file structure includes the validity period within the
stored object file.

The system does not care how the object file got there; it cares about
the file name and file contents.

So, "no".

(At least, not without writing your own special-case caching system.)

What is the thing that you want to achieve? Perhaps there is an alternate
way to get to the same desired end result.

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

Re: 2 locations, 2 _different_ cache valid settings, but same cache & pass-through

Francis Daly March 27, 2020 04:24AM

RE: 2 locations, 2 _different_ cache valid settings, but same cache & pass-through

Reinis Rozitis March 27, 2020 07:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
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