Question

i just ran yslow against my website and i had a question around Expiry Headers: YSlow gave me an : Grade F on Add Expires headers. There are 20 static components without a far-future expiration date. These are all css or js files.

Right now when i go to IIS (6.0), and go to the http headers tab, Enable Content Expiration is NOT checked. from reading this it seems like this is the right thing to do as the browser will then cache the content. So i am confused why yslow is complaining. Also, it sounds like browsers will cache this data by modified date anyway so is this whole thing meaningless ??

So if setting this is a no brainer, why isn't this the default behavior??

Can someone please clarify.

Was it helpful?

Solution

There's no contradiction here. What you need to do is set content expiration on the folders which contain static content. Such as your image, css, and script folders. You can set the content expiration on a folder-basis in IIS and other web servers.

OTHER TIPS

A browser has no idea what content is 'static' or not; it literally has no way of knowing, and yslow is only guessing, most likely. It's probably guessing correctly... but having incorrect Expires values by default in the web server could cause browsers to cache dynamic content that you do not want them caching at all.

That's why it's not set like that by default.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top