selective caching

Maxim Dounin mdounin at mdounin.ru
Fri Jul 24 20:38:13 MSD 2009


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?

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://...
    }

See http://wiki.nginx.org/NginxHttpCoreModule#location for details 
about locations.

Maxim Dounin





More information about the nginx mailing list