Welcome! Log In Create A New Profile

Advanced

Re: Nginx proxy cache doesn't update cache-control max-age time!

Maxim Dounin
April 06, 2020 12:00PM
Hello!

On Mon, Apr 06, 2020 at 10:26:04AM -0500, J.R. wrote:

> This was driving me crazy and I think I've figured out the problem.
>
> I started using the proxy cache (which is great, saves regenerating a
> lot of dynamic pages), except a bunch of my pages expire at a very
> specific time, at the start of the hour, and my cache-control /
> expires headers reflect that, because that's when the data is updated.
>
> I started noticing stale pages shortly thereafter. Watching the
> headers I realized that the 'max-age' time wasn't decreasing like it
> should be, thus pages would end up being cached by clients longer than
> they should be as I guess browsers consider this the most 'modern'.
>
> Is there a setting I'm missing, or is there a way to have nginx
> dynamically update the max-age while still maintaining the proxy
> cache?

There is no Age header support in nginx as of now (relevant ticket
in Trac: https://trac.nginx.org/nginx/ticket/146). If you want
pages to expire at a specific time regardless of intermediate
caching, consider using the "Expires" header.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx proxy cache doesn't update cache-control max-age time!

J.R. April 06, 2020 11:28AM

Re: Nginx proxy cache doesn't update cache-control max-age time!

Maxim Dounin April 06, 2020 12:00PM

Re: Nginx proxy cache doesn't update cache-control max-age time!

J.R. April 06, 2020 01:26PM

Re: Nginx proxy cache doesn't update cache-control max-age time!

Maxim Dounin April 06, 2020 02:36PM

Re: Nginx proxy cache doesn't update cache-control max-age time!

J.R. April 06, 2020 07:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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