Old thread: Cache for non-cookie users andfresh for cookie users
quintinpar at gmail.com
Sat Feb 18 07:36:46 UTC 2012
Not directly related, but here’s an entry from 37Signal’s David who talks
about invalidating individual cache entries and keeping it clean as
opposing to a whole purge.
This is the way they keep cache fresh in with Basecamp, though it is in
On Sat, Feb 11, 2012 at 11:53 PM, Max <nginxyz at mail.ru> wrote:
> 11 февраля 2012, 04:07 от António P. P. Almeida <appa at perusio.net>:
> > On 10 Fev 2012 17h47 WET, nginxyz at mail.ru wrote:
> > >
> > > The default behaviour is not to cache POST method request responses,
> > > but I turned caching of POST method request responses ON, so I had
> > > to make sure the cache is bypassed for POST method requests (but
> > > not for GET or HEAD method requests!). All POST method requests
> > > are passed on to the backend without checking for a match in the
> > > cache, but - CONTRARY to the default behavior - all POST method
> > > request responses are cached.
> > >
> > > Without the @post_and_refresh_cache location block and without
> > > the proxy_cache_bypass directive, nginx would check the cache
> > > and return the content from the cache (put there by a previous
> > > GET request response, for example) and would not pass the POST
> > > method request on to the backend, which is definitely not what
> > > you want in this case.
> > If what the OP wanted was to distinguish between cached POST and GET
> > request responses then just add $request_method to the cache key.
> That's not what the OP wanted, and that's not what the approach
> I described does. The OP wants to be able to invalidate cache entries
> on demand without using 3rd party modules. Since, AFAIK, there's no
> way to do that without using 3rd party modules, the alternative is to
> make sure the cache is as fresh as possible. This can be done by making
> sure POST method requests refresh the appropriate cache entries
> automatically and/or by having special location blocks for refreshing
> specific cache entries on demand.
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx