should all asp.net-mvc sites set the Content and Scripts directory with far in the future expiry headers in IIS?
based on what i have read, it would be correct behavior to ALWAYS set future header expiry to the Content and Scripts directory for any ASP.NET-mvc page given that it is static content.
Is there any reason you wouldn't do this?
Als开发者_StackOverflowo, if i release a new version of the static files, I assume IIS and the browser is smart enough to load the newer file. I am correct in that assumption?
Yes, using caching static files such as Content and Scripts folders is a good practice.
Also, if i release a new version of the static files, I assume IIS and the browser is smart enough to load the newer file.
No, you are not correct in assuming this. You could use version numbers. For example here's how the CSS for this site looks:
http://sstatic.net/stackoverflow/all.css?v=96e92394e123
So whenever you release a new version you change the number.
精彩评论