I'm a web developer and administer of a Windows 2008R2 Cloud Instance with IIS 7. I recently made an update to our website, but when I revisited the website, the website was being viewed with old stylings. I did a refresh (shift + reload button in Firefox) and of course the website displayed as it should. I didn't worry about it, until my client had the same issue in Safari.

So, my question, in general, is, how do I prevent this from happening again, and yet still afford some caching of our site?

I noticed we did not have content expiration set up on our webserver sites, so I've set that up, but did I really need to?

I've also looked at Etags, and, honestly, it's hard for me to know whether or not I should use them or not. One comment I read somewhere there isn't really any issue with Etags scenarios in IIS (even in webfarms)... but, I dunno.

Anybody have any suggestions, links, info? Thanks.


The easist way to solve this is version the name of your CSS file e.g. style-v1.css, increment the number when you make major changes and you'll never have this problem again.

Having far future expiration dates on your images and media helps your users as they don't download the same files over and over again while browsing your site. Both expiration dates and ETags are part of front end optimization best practice.

  • I'll admit, this would work, but that's just ... it would be very intractable to manage, complicates the use of a source code control system, and likely somebody's just going to mess up somewhere. A few years back, I dealt with the (potential) issue on a different by appending a query string built off some random number internally generated by the last build, and it did work (I don't recall that we ever had any issues), but it was still a pain to manage. It's "fixes" like these which I'm trying to avoid. – JayC Mar 22 '12 at 20:51
  • Well there are ways to integrate something like this in SVN but it's one of those once in a blue moon issues that is just as easily solved with ctrl+F5. – toomanyairmiles Mar 22 '12 at 21:09
  • I do like that link you just gave me... after I posted the question, I thought something with url rewrites might just work. I'll have to sleep over it. – JayC Mar 22 '12 at 21:27
  • @JayC I'd be curious to know what you decide. – toomanyairmiles Mar 22 '12 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.