Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm hosting redmine with nginx + thin with static content caching

Question is: is it or is it not cached by the browser?

nginx caching config:

location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
    # Some basic cache-control for static files to be sent to the browser
    expires max;
    add_header Pragma public;
    add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}

here are response headers:

Request URL:http://redmine/javascripts/prototype.js?1251746896
Request Method:GET
Status Code:304 Not Modified

Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Cache-Control:max-age=0
Connection:keep-alive
Cookie: <hiden>
Host:redmine
If-Modified-Since:Mon, 31 Aug 2009 19:28:16 GMT
Referer:http://redmine/issues/
User-Agent: <someuseragent>
Query String Parameters
1251746896:

Response Headers
Cache-Control:max-age=315360000, public, must-revalidate, proxy-revalidate
Connection:keep-alive
Date:Fri, 09 Dec 2011 01:15:12 GMT
Expires:Thu, 31 Dec 2037 23:55:55 GMT
Last-Modified:Mon, 31 Aug 2009 19:28:16 GMT
Pragma:public
Server:nginx/0.7.67

Yet chromium audit still says:

The following resources are explicitly non-cacheable. Consider making them cacheable if possible:
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Doesn't must-revalidate at least make the browser query to see if the resource has changed, even if it doesn't need to redownload the content? It will accept a "not changed" response but still have to query the server to get that rather than using the locally cached copy directly.

Chromium may be reporting this as meaning the content is not completely cacheable - try removing the revalidate related directives and see what difference that makes.

share|improve this answer
    
The browser should only recheck after the freshness period has passed, so no, it need not and should not query until then. Therefore the page is or should be cacheable and either Chrome's message or behavior is incorrect, according to the HTTP spec for must-revalidate. –  Lawrence Dol Dec 2 at 21:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.