Welcome! Log In Create A New Profile

Advanced

Re: Skipping the proxy cache based on a cookie?

January 19, 2011 03:43PM
António P. P. Almeida Wrote:
-------------------------------------------------------
> On 19 Jan 2011 19h58 WET, nginx-forum@nginx.us
> wrote:
>
> > I think I am getting closer and hope someone can
> nudge me across the
> > line.
> >
> > My set up is now ...
> >
> >
> > if ($http_cookie !~* "mycookie=0") {
> > add_header Cookie: "mycookie=1";
> > }
> >
>
> IIRC you *want* to bust the proxy cache. Right?
> So,
> http://wiki.nginx.org/HttpProxyModule#proxy_no_cac
> he
>
> If you want a header do as describe, this if you
> don't want to cache
> the response. If not use a cache busting variable,
> to force a refresh.
>
> --- appa
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


Hi

Thanks for the stopping by.

i am already using proxy_cache_bypass and proxy_no_cache.

What I am trying to do is as follows

1. User requests page and Nginx checks for cookie and if not present, sets cookie value to 1. Default cookie value is 0.
2. Cookie is evaluated against proxy_cache_bypass and proxy_no_cache so that if value is 1, user gets passed to backend and response is not cached
3. Backend checks for cookie and if value is 1, sets value to 0 and serves specific additional content
4. User requests another page and this time cookie is present with 0 value so Step 1 is skipped
5. Cookie is evaluated against proxy_cache_bypass and proxy_no_cache and since value is 0, user gets served from cache or if cache is stale, from backend
6. If user is passed to backend, backend checks for cookie and since value is 0, serves normal content

I have Steps 2 onwards basically setup but Step 1 is where it is falling down. I can't get Nginx to set that cookie.

Thanks again
Subject Author Posted

Skipping the proxy cache based on a cookie?

ehudros2 December 29, 2010 09:15AM

Re: Skipping the proxy cache based on a cookie?

ehudros2 December 30, 2010 08:27AM

Re: Skipping the proxy cache based on a cookie?

Dayo January 01, 2011 10:52AM

Re: Skipping the proxy cache based on a cookie?

ehudros2 January 02, 2011 07:28AM

Re: Skipping the proxy cache based on a cookie?

Dayo January 18, 2011 04:34PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 18, 2011 05:00PM

Re: Skipping the proxy cache based on a cookie?

agentzh January 19, 2011 11:08PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 20, 2011 03:38PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 18, 2011 05:18PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 01:44PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 01:45PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 02:06PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 02:07PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 05:19PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 02:58PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 04:49PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 19, 2011 03:20PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 03:43PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 19, 2011 04:22PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 19, 2011 04:10PM

Re: Skipping the proxy cache based on a cookie?

Eugaia January 19, 2011 04:30PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 19, 2011 04:36PM

Re: Skipping the proxy cache based on a cookie?

António P. P. Almeida January 19, 2011 08:30PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 20, 2011 03:08PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 21, 2011 03:51PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 21, 2011 03:52PM

Re: Skipping the proxy cache based on a cookie?

Dayo January 21, 2011 04:17PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready