cache-control max-age
|
04-23-2011, 09:50 AM
Post: #1
|
|||
|
|||
cache-control max-age
Hello Community,
A question abut the cache-control setting in the request/response headers. Do they have to match? I have set the max-age in the response (IIS config) to X days, but when the request header is showing max-age set to 0. Is that expected? I would think NOT. Thank you in advance. Regards, TRX |
|||
04-23-2011, 10:06 AM
Post: #2
|
|||
|
|||
RE: cache-control max-age
I assume you mean the response header, not request, right? Any chance you have a link to a result with the headers? Sounds like the IIS setting isn't being applied for some reason.
|
|||
04-25-2011, 04:11 AM
(This post was last modified: 04-25-2011 04:11 AM by trx.)
Post: #3
|
|||
|
|||
RE: cache-control max-age
I have attached an image of what I mean.
Does both the response/request headers "max-age" must match? This is a second hit on the same page. |
|||
04-25-2011, 10:40 PM
Post: #4
|
|||
|
|||
RE: cache-control max-age
Are you doing a force-refresh/reload of the page? They have different meanings on the request and response so no, they don't need to match.
|
|||
04-26-2011, 01:29 AM
Post: #5
|
|||
|
|||
RE: cache-control max-age
Thanks. So when I run a webpagetest, it always fails on the category of not setting any static files to have an expiration or max-age. I would of thought with my setting in IIS "Cache-Control: public, max-age=xyz", would do the trick, but I see that it is not the case. Any ideas on why this is happening or how to get this accomplished so webpagetest will mark it as NOT an F?
Regards, TRX |
|||
04-26-2011, 02:16 AM
Post: #6
|
|||
|
|||
RE: cache-control max-age
Do you have a link to a test result? That will help in identifying the specific requests it is having a problem with and show the headers that WebPagetest is seeing.
Thanks, -Pat |
|||
04-26-2011, 05:12 AM
Post: #7
|
|||
|
|||
RE: cache-control max-age
Hello Pat,
I have re-tested and webpagetest.org grades it an A for http://www.qad.com. Couple of questions: 1) Should the "max-age" in the request be zero, when hitting the same page a 2nd time with an f5/refresh? NOTE: Please refer to the screen shot of the request header. Thanks. Regards, TRX |
|||
04-26-2011, 05:17 AM
Post: #8
|
|||
|
|||
RE: cache-control max-age
Yes, in a forced refresh it is normal for the client to request max-age: 0
That is the browser's way of telling the server and any intermediate proxies that it needs the current version of the file and not to serve a version that was cached somewhere along the path. A reload of the page behaves very differently from actually navigating to a page for a second time. WebPagetest's repeat views are done by closing the browser and then loading the page again in a new instance (browsers have an in-memory cache that behaves differently from the normal caching as well which is why we close the browser out). Thanks, -Pat |
|||
04-26-2011, 05:24 AM
Post: #9
|
|||
|
|||
RE: cache-control max-age
Thanks! What would be the best tool to find out and see that a specific image/static file is being served from the local cache?
Regards, TRX |
|||
04-26-2011, 07:08 AM
Post: #10
|
|||
|
|||
RE: cache-control max-age
Run WebPagetest and look at the repeat view test result? You can also use HttpWatch (for IE) or Chrome's developer tools, both of which should tell you which resources came from local disk cache.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)