Invalidate just one page under a location directive.

Quintin Par quintinpar at gmail.com
Wed Feb 8 09:36:31 UTC 2012


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 Валентин Бартенев <ne at vbart.ru>

> 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?
> >
>
> The best way would be to create a location for this particular page:
>
>  location /industry/category/cars {
>      ...
>  }
>
> http://nginx.org/en/docs/http/ngx_http_core_module.html#location
>
>
> also, you can utilize the map directive functionality, e.g:
>
>  map $uri $is_cached_uri {
>      default                  1;
>      /industry/category/cars  0;
>  }
>
>  proxy_cache_bypass $is_cached_uri;
>
> http://wiki.nginx.org/HttpMapModule
>
>
>  wbr, Valentin V. Bartenev
>
> _______________________________________________
> 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/e9e39787/attachment.html>


More information about the nginx mailing list