Welcome! Log In Create A New Profile

Advanced

caching: Expires takes precedence over max-age

August 01, 2013 03:59AM
Hello, I have a trouble with nginx caching pages it shouldn't cache. I have uwsgi_cache enabled:

uwsgi_cache_path /tmp/cache levels=1:2 keys_zone=django:1m;
location /test {
uwsgi_pass unix:/tmp/uwsgi.sock;
uwsgi_cache django;
}

nginx caches responses that have Expires header set in the future, even if Cache-Control says otherwise:

Expires: Fri, 02 Aug 2013 19:47:42 GMT
Cache-Control: no-cache, must-revalidate, max-age=0

And rfc2616 says:

Note: if a response includes a Cache-Control field with the max-
age directive (see section 14.9.3), that directive overrides the
Expires field.

Happens on nginx 1.2.1 and 1.4.1. If I add "uwsgi_ignore_headers Expires;" to the nginx conf, the pages don't get cached. Is there something wrong with my nginx or uwsgi response headers?
SubjectAuthorPosted

caching: Expires takes precedence over max-age

hippoAugust 01, 2013 03:59AM

Re: caching: Expires takes precedence over max-age

Maxim DouninAugust 02, 2013 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready