Skipping the proxy cache based on a cookie?

Dayo nginx-forum at
Wed Jan 19 00:34:17 MSK 2011

Just came back to this as I have hit this wall and it would be very
useful if the roxy no cache and proxy bypass could be triggered based on
the [u]absence[/u] of a cookie.

I need to pass first time visitors to the backend and I need to make
sure the content they get is not cached. As they are first time
visitors, I can't rely on the presence of a cookie to tell this and the
only way I can think off is to check for the absence of a cookie.

Any chance of implementing ...
proxy_cache_bypass_empty $cookie_COOKIE;
proxy_no_cache_empty $cookie_COOKIE;

... which would do the same as the standard modes except that they would
be triggered if the cookie or header is absent or empty.


Posted at Nginx Forum:,161969,167367#msg-167367

More information about the nginx mailing list