Welcome! Log In Create A New Profile

Advanced

Re: nginx 0.7.64 ignoring Cache-Control headers

Maxim Dounin
February 06, 2010 05:28PM
Hello!

On Sat, Feb 06, 2010 at 05:10:53PM -0500, Kura wrote:

> Hey guys, I apologise if this is covered in another topic, I
> have searched many pages on the forum and not come across this
> issue.
>
> I'm using nginx v. 0.7.64 with the following: --with-debug
> --with-http_stub_status_module --with-http_flv_module
> --with-http_ssl_module --with-http_dav_module
> --with-http_gzip_static_module --with-mail
> --with-mail_ssl_module --with-ipv6

[...]

> And placed several test PHP files in to the host directory with
> different Cache-Control headers
>
> 1.php
> <?
> header("Cache-Control: private,max-age=0");
> echo "test";
> ?>
>
> 2.php
> <?
> header("Cache-Control: public,max-age=3600");
> echo "test";
> ?>
>
> When I access both files with Firefox and inspect their headers
> using Live HTTP Headers I can see that the correct Cache-Control
> headers are there, yet nginx is ignoring them and caching both
> files.
>
> Am I missing a module or a patch? I was advised in another post
> that this was one of the ways to control which files nginx
> actually cached and this seemed like the best approach to it.

nginx honors "max-age=" and "no-cache" directives from
Cache-Control header.

But there is a bug in 0.7.64 with parsing Cache-Control with
multiple directives, it was fixed in 0.8.20 and bugfix was merged
into 0.7.65:

*) Bugfix: nginx did not treat a comma as separator in the
"Cache-Control" backend response header line.

Please upgrade.

Maxim Dounin

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

nginx 0.7.64 ignoring Cache-Control headers

Kura February 06, 2010 05:10PM

Re: nginx 0.7.64 ignoring Cache-Control headers

Maxim Dounin February 06, 2010 05:28PM

Re: nginx 0.7.64 ignoring Cache-Control headers

Kura February 06, 2010 05:39PM

Re: nginx 0.7.64 ignoring Cache-Control headers

Kura February 06, 2010 05:58PM

Re: nginx 0.7.64 ignoring Cache-Control headers

Maxim Dounin February 06, 2010 06:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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