Hi guys,
I have a certain use case that I cannot solve and I hope you can help me.
What the problem looks like:
Step 1) nginx correctly caches a static page for 1 minute with this header: cache-control: max-age=60, public
Step 2) now I change the page to be a dynamic page that should not be cached anymore and send this header: cache-control: no-cache
Step 3) nginx keeps delivering the old, cached page as a stale page instead of the fresh, dynamic page
What the config looks like (most important lines):
proxy_cache_use_stale updating error timeout http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
proxy_cache_revalidate on;
What probably happens:
Nginx tries to update the stale page in the background.
But as it receives a page which says "cache-control: no-cache", it keeps delivering the old, stale content.
What the solution should probably do:
Purge the old cache entry and deliver the fresh, dynamic page.
Any ideas how to achieve this?
Thanks a lot,
Michael
I have a certain use case that I cannot solve and I hope you can help me.
What the problem looks like:
Step 1) nginx correctly caches a static page for 1 minute with this header: cache-control: max-age=60, public
Step 2) now I change the page to be a dynamic page that should not be cached anymore and send this header: cache-control: no-cache
Step 3) nginx keeps delivering the old, cached page as a stale page instead of the fresh, dynamic page
What the config looks like (most important lines):
proxy_cache_use_stale updating error timeout http_500 http_502 http_503 http_504;
proxy_cache_background_update on;
proxy_cache_revalidate on;
What probably happens:
Nginx tries to update the stale page in the background.
But as it receives a page which says "cache-control: no-cache", it keeps delivering the old, stale content.
What the solution should probably do:
Purge the old cache entry and deliver the fresh, dynamic page.
Any ideas how to achieve this?
Thanks a lot,
Michael