开发者

YSlow recommendations. In IIS, why wouldn't Enable Content Expiration be checked by default in

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开发者_如何学C 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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜