Caching for a location based on cookie

agentzh agentzh at gmail.com
Fri Jan 15 12:07:46 MSK 2010


On Fri, Jan 15, 2010 at 4:06 PM, Vinay Y S <vinay.ys at gmail.com> wrote:
>
> Hi,
> For a given location, I want the requests to be cached only if a particular cookie is not present. How do I achieve that with nginx?
> Currently I'm trying following config
>     location /album {
>         if ($cookie_logintoken ~* "") {
>             set $cache_key $scheme$proxy_host$uri$is_args$args;
>         }

Please see this thread for a simple solution:

    http://forum.nginx.org/read.php?2,25197

Hope this helps.

Cheers,
-agentzh



More information about the nginx mailing list