Invalidate just one page under a location directive.

Quintin Par quintinpar at
Wed Feb 8 16:22:43 UTC 2012

Invalidate a cache page using the bypass mechanism proxy_cache_bypass, not

To put it simply, Invalidate cache for  a particular key entry but not all
of the cache

e.g for

location = /vehicles {

proxy_cache_key         $request_uri;


Hashtable for cache:

[ => cached page for cars => cached page for bus> cached page for bike
+ 10,000 key, values

I should be able to invalidate just "cars" because my page for cars have
changed but not others. Say a person added a comment in the cars page.
Another analogy is to invalidate cache for a single blog post when all the
blog posts have been cached under a single location directive.

On Wed, Feb 8, 2012 at 9:45 PM, António P. P. Almeida <appa at>wrote:

> On 8 Fev 2012 15h59 WET, quintinpar at wrote:
> > Can someone help? My small site on a tiny VM is being bombarded and
> > the cache invalidation is clearing up everything. Which means
> > warming up the caching takes a lot of expensive queries.
> What cache invalidation? What caching strategy are you using?
> Are working with a content based expiration logic or from a
> microcaching perspective?
> You can inspect the cache using a small shell script:
> --- appa
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list