Maxim Dounin
March 13, 2014 12:32PM
Hello!

On Thu, Mar 13, 2014 at 12:20:41PM -0400, bcx wrote:

> I noticed that the nginx http proxy module by default does nothing with the
> Cache-Control request header that is sent by browsers.
>
> Most browsers (I tested Crome and Firefox, but from my online research it
> showed that even Internet Explorer has the same behaviour) send a
> Cache-Control: no-cache header when the page requested is with Ctrl-F5 (as
> opposed to a normal F5 or page hit). I would like to configure my nginx
> caching proxy to take this request as an instruction to invalidate the
> cache, send a request to an upstream server, and send and cache that
> response.
>
> Note that I'm NOT talking about the Cache-Control header sent from upstream
> webservers to the proxy. It's the Cache-Control request headers, not the
> response header.
>
> Is there a configuration option that I've missed? I spent quite some time
> reading the documentation. Sadly the search terms that I can come up with
> (cache-control, proxy, etc) are too generic for what I want to express.

The proxy_cache_bypass directive can be used for what you are
looking for, see docs here:

http://nginx.org/r/proxy_cache_bypass

(Note well that in many cases it's not a good idea to allow users
to bypass server-side cache, as this may be used as a DoS vector.)

--
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: 300
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