tags:

views:

13

answers:

1

I am trying to cache the css and js files for my mvc project, and I found a solution to the problem I would like to implement. StackOverflow uses parameters in its header links to only refresh the files in the cache when they change their resource number.

For those who are unfamiliar, the question I found this solution in is here:

http://stackoverflow.com/questions/438821/what-does-do-in-a-css-link/438828

Problem is that my project keeps giving me 304s for those files when they load. They have the same parameter and full http:... path but still the page loads and checks every time. I'm checking using the same browser for both stackoverflow and my project so I'm assuming its not a settings problems. Even hit my project's site from a different computer and still got 304.

What could possibly be going on that causes my browser to check for a new version of the file, when it does not do that for stack overflow?

A: 

I solved it myself.

For those who also had this problem, the answer was that even with the parameter in the url you must specify a cache-control duration under your IIS settings. This apparently lets the browser stop checking for an up to date version every page load.

Brit