Welcome! Log In Create A New Profile

Advanced

Re: Ignored Cache-Control request header

Maxim Dounin
March 14, 2014 05:12AM
Hello!

On Thu, Mar 13, 2014 at 06:34:52PM -0400, bcx wrote:

> Thank you for your suggestion. I understand about the DoS issue.
> proxy_cache_bypass indeed is the solution. Documentation was not clear about
> it, but the result is written to cache. The cache is only bypassed in the
> lookup fase, not in the write back fase.

Documentation explicitly says that proxy_cache_bypass "defines
conditions under which the response will not be taken from a
cache". There is proxy_no_cache to control saving responses to
a cache.

> I worked out this bit of configuration. The added header is very useful
> while testing, I'd remove it in production.
>
> location / {
> if ($http_cache_control = "no-cache") {
> set $ctrl_Ffive_ed "yes";
> }
> proxy_cache_bypass $ctrl_Ffive_ed;
> add_header X-cache-bypass $ctrl_Ffive_ed;

Just a side note:

Use of map{} for such things is usually a better idea, though it
probably doesn't matter for testing.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Ignored Cache-Control request header

bcx March 13, 2014 12:20PM

Re: Ignored Cache-Control request header

Maxim Dounin March 13, 2014 12:32PM

Re: Ignored Cache-Control request header

bcx March 13, 2014 06:34PM

Re: Ignored Cache-Control request header

Maxim Dounin March 14, 2014 05:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready