Welcome! Log In Create A New Profile

Advanced

Re: Debugging FastCGI caching

Maxim Dounin
January 28, 2013 03:52AM
Hello!

On Mon, Jan 28, 2013 at 01:28:36AM -0500, Daniel15 wrote:

> Francis Daly Wrote:
> -------------------------------------------------------
> > $ curl -i -I http://dan.cx/
> > HTTP/1.1 200 OK
> > ....
> > Cache-Control: private
> > ....
> >
> > I don't see anything in your config which adds that header, so
> > presumably it is coming from upstream.
>
> Thanks, Mono / ASP.NET must be adding that by default (as I have not
> explicitly added any caching headers). I'll set the correct caching headers
> for this page.
>
> Based on this, I assume that Nginx only caches responses with Cache-Control:
> public (or similar) headers? I couldn't find this documented anywhere on the
> Nginx site so I wasn't sure.

Yes, any of the "private", "no-cache" and "no-store" in
Cache-Control disables cache.

> Does Nginx use the Expires or Max-Age headers, and how do these work with
> fastcgi_cache_valid? If the Max-Age is 1 hour and Expires is 1 hour in the
> future, but fastcgi_cache_valid is set to 2 hours, how long would Nginx
> cache the response for?

The "Expires" header takes precedence over fastcgi_cache_valid
(unless ignored with fastcgi_ignore_headers; and, BTW, this is
documented at http://nginx.org/r/fastcgi_cache_valid).

There is no "Max-Age" header, but the "max-age" directive of the
"Cache-Control" header, and it takes precedence over
fastcgi_cache_valid as well.

--
Maxim Dounin
http://nginx.com/support.html

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

Debugging FastCGI caching

Daniel15 January 27, 2013 07:12AM

Re: Debugging FastCGI caching

Francis Daly January 27, 2013 07:34AM

Re: Debugging FastCGI caching

Daniel15 January 28, 2013 01:28AM

Re: Debugging FastCGI caching

Maxim Dounin January 28, 2013 03:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
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