Welcome! Log In Create A New Profile

Advanced

s-maxage not being honored with proxy_cache

Ryan Parrish
April 23, 2013 11:08AM
I have a slow backend application that I'm using nginx to provide
the authentication and caching for. It's been working great however there
is one nagging issue that I cannot seem to resolve, when the backend app
sets a s-maxage and a maxage Cache-Control, nginx only seems to honor the
maxage and expires the cache with its value.

An example response from the backend is like this...

Cache-Control: max-age=60, s-maxage=3600, public, must-revalidate
My idea here is I only want the client to cache this data for a short
amount of time before checking in with me it see if it's still valid. The
data usually wont be changing that often so I want nginx to cache it for an
hour, but in the event it does I use the excellent nginx-cache-purge script
in my backend app to invalidate the cache and the next time a client checks
in (after 60 seconds) they will get the new data.

However in all my testing and usage I will only get a cache HIT for 60
seconds after the first request to a resource, after 60 seconds it will be
EXPIRED then it will go to the backend again. Am I missing something in
the Cache-Control that is causing this behavior?



--

Ryan Parrish
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

s-maxage not being honored with proxy_cache

Ryan Parrish April 23, 2013 11:08AM

Re: s-maxage not being honored with proxy_cache

Maxim Dounin April 24, 2013 07:44AM

Re: s-maxage not being honored with proxy_cache

Ryan Parrish April 24, 2013 09:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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