Invalidate just one page under a location directive.

Quintin Par quintinpar at gmail.com
Wed Feb 8 15:59:21 UTC 2012


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.

-Quintin

On Wed, Feb 8, 2012 at 6:27 PM, Quintin Par <quintinpar at gmail.com> wrote:

> I don’t think I made that clear.
>
> 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:
>
> [
>
> hittp://jj.com/vehicles/cars => hittp://jj.com/vehicles/cars
>
> hittp://jj.com/vehicles/bus => hittp://jj.com/vehicles/bus
>
> hittp://jj.com/vehicles/bike=> hittp://jj.com/vehicles/bike
>
> ]
>
> I should be able to invalidate just cars because my page for cars have
> changed but not others.
>
> Hope you got the point.
>
> Quintin
>
>
>
> On Wed, Feb 8, 2012 at 5:49 PM, Quintin Par <quintinpar at gmail.com> wrote:
>
>> Simples way to say this would be, invalidate proxy_cache_key but not all
>> of the cache.
>>
>> On Wed, Feb 8, 2012 at 5:32 PM, Max <nginxyz at mail.ru> wrote:
>>
>>>  08 февраля 2012, 13:37 от Quintin Par **: > Thanks would be difficult
>>> because my intention is to maintain per page > cache. So we are talking
>>> about 1000+ pages and more being created > dynamically. > > -Quintin > >
>>> 2012/2/8 Валентин Бартенев ** > > > On Wednesday 08 February 2012
>>> 11:44:04 Quintin Par wrote: > > > Hi all, > > > > > > A section of my
>>> virtual(say /industry) is cached with > > > > > > proxy_cache_key
>>> $scheme$host$request_uri; > > > > > > key. This will cache all pages under
>>> this virtual. I do cache > > invalidation > > > by firing a request with >
>>> > > > > > proxy_cache_bypass > > > > > > Now if I need to invalidate cache
>>> for a page under this virtual, how > > should > > > I go about doing it? >
>>> > > > > > Say /industry is the location directive > > > > > > I need to
>>> invalidate just > > > > > > /industry/category/cars > > > > > > How do I do
>>> this? Do you want to do per-request cache invalidation based on client
>>> information (header values, cookies, originating IP etc.), so the cache is
>>> bypassed whenever a client sends a request that matches your cache
>>> invalidation criteria, or do you want to be able to invalidate a certain
>>> URI for all future clients and requests by sending some kind of "switch
>>> caching off for this URI" request? 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/20120208/04c8caf9/attachment.html>


More information about the nginx mailing list