Welcome! Log In Create A New Profile

Advanced

bypassing and replacing cache if origin changed - or purging cache when origin changed?

January 25, 2019 03:28PM
I have nginx configured to cache certain requests mapped by tenant/host/uri/args - these files wouldn't change often, but if they do, i want nginx to fetch them new.

I don't have NginxPlus - and I'm running Nginx docker. Some things that I have investigated, but not sure how I could configure to make it work is: the proxy_cache_bypass and the expires settings.

But I'm not sure about whether something like: expires $upstream_http_expires 1d; would work? If it checks upstream every time, it would defeat the purpose of caching. What exactly do I need to configure if I want to test whether for a given cache-key on the upstream server, is there new content? (I can implement an api that could test whether new content is available.)

Another option is to implement a fastcgi script that would test the upstream api and purge the cache based on that, but I'm hoping that I can leverage the power of Nginx rather than having an additional script to maintain. Thanks in advance.
Subject Author Posted

bypassing and replacing cache if origin changed - or purging cache when origin changed?

nenaB January 25, 2019 03:28PM

Re: bypassing and replacing cache if origin changed - or purging cache when origin changed?

Francis Daly February 05, 2019 07:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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