Multiple caching solutions for anonymous and logged in users with SSI on

Quintin Par quintinpar at gmail.com
Tue Mar 6 08:49:36 UTC 2012


Thanks Antonio.

On a side note, if I craft a proxy cache key with cookie_sessionid and if
the sessionid cookie does not exist, *will nginx take it as an empty value*?


Can nginx do a try_files or “if” on the existence of a cookie? This will
help me deliver two caching strategies in the same location directive.

-Quintin

On Tue, Mar 6, 2012 at 6:29 AM, António P. P. Almeida <appa at perusio.net>wrote:

> On 5 Mar 2012 04h20 CET, quintinpar at gmail.com wrote:
>
> > Hi all,
> >
> > I guess many people didn't understand my question.
> >
> > To make it simple, Can I have two caching strategies together:
> >
> > one for logged in users and one for non-logged in users in the same
> > location directive?
>
> I think that you need two locations for each batch of users. Define
> two locations and use map to test for the session cookie. If Present
> return a 418 and use error_page to redirect to the logged in users
> setup.
>
> You probably can do more "dynamic" things using the embedded Lua
> module [1].
>
> --- appa
>
> [1] http://wiki.nginx.org/HttpLuaModule
>
> _______________________________________________
> 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/20120306/38c5a297/attachment.html>


More information about the nginx mailing list