Old thread: Cache for non-cookie users andfresh for cookie users

Quintin Par 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.

http://37signals.com/svn/posts/3112-how-basecamp-next-got-to-be-so-damn-fast-without-using-much-client-side-ui

This is the way they keep cache fresh in with Basecamp, though it is in
memcached.

- Quintin

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.
>
> Max
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120218/9bbb90af/attachment.html>


More information about the nginx mailing list