selective caching

Maxim Dounin mdounin at mdounin.ru
Sat Jul 25 03:09:25 MSD 2009


Hello!

On Sat, Jul 25, 2009 at 12:46:46AM +0200, Jérôme Loyet wrote:

> 2009/7/24 Maxim Dounin <mdounin at mdounin.ru>:
> > Hello!
> >
> > On Fri, Jul 24, 2009 at 12:29:16PM -0400, vburshteyn wrote:
> >
> >> so i am using cache to great effect to cache and speed the site.
> >>
> >> I am just curious is there a way to do selective caching?  it is imperitive that i keep one stupid URL from caching.  Is that possible?
> 
> yes use proxy_cache none;

Have you tried?

There is nothing specifal in "none" used as proxy_cache argument.  
If you want to clear proxy_cache inherited from upper levels you 
should use "off" instead.

But this isn't needed in the example below as there is no 
inherited proxy_cache.

Maxim Dounin

> 
> >
> > Just configure different locations for urls you want to be cached
> > and urls you don't want to.  E.g.
> >
> >    location / {
> >        proxy_pass http://...
> >
> >        # cache everything here
> >        proxy_cache blah;
> >        ...
> >    }
> >
> >    location /do-not-cache-here {
> >        proxy_pass http://...
>           proxy_cache none;
> >    }
> >
> > See http://wiki.nginx.org/NginxHttpCoreModule#location for details
> > about locations.
> >
> > Maxim Dounin
> >
> >
> 





More information about the nginx mailing list