Alex
Alex

Reputation:

CSS reload on IE7

It looks like IE7 doesn't reload the latest version of my stylesheet each time I upload a new version on the server. This is annoying as I am debugging my .css file to make it work on IE... Tried to empty the browser cache but still not working.

Thanks for your help.

Upvotes: 1

Views: 3052

Answers (5)

Noon Silk
Noon Silk

Reputation: 55082

When testing, every time you do an update you can just wite "stylesheet.css?r=98123"

As long as the query string is different, it'll be downloaded again.

If you need, you can use javascript to append Math.random(), to get the random number. Not required on production though, when updates would be stable.

Upvotes: 1

Alex
Alex

Reputation:

Thanks to you all!

I did manage to solve my problem with the "stupid" Ctrl+F5, and by changing the Internet Parameters of Windows to reload content every new visit.

Upvotes: 0

Luis Melgratti
Luis Melgratti

Reputation: 12050

Include your version number in the file name. myfile_v1234.css

Upvotes: 1

Anthony
Anthony

Reputation: 37065

2 Questions:

  1. Does IE eventually load with the newer stylesheet?

  2. How are you saving the changes to the server (SSH, Web Interface, etc.)?

I ask because I ran into an issue with a web-based file management system a while back where one browser would show the CSS just fine, the other wouldn't, and we noticed the issue of which browser played nicely depended on which browser we used to upload the CSS.

The reason turned out to be that IE gave the CSS file a different MIME type than Firefox. If you continue to notice the issue even when you've cleared the cache, check the MIME type of the file using Firefox by going to Tools > Page Info.

Also, if it is simply a caching issue, consider turning caching off in IE. I believe this should be an Advanced Option under Internet Options.

Also, you may want to try creating a special developer environment for IE (if it comes down to it.) Perhaps have another machine with IE7 and no caching and any other features turned off (A kiosk mode, perhaps), and then previewing the page on that machine.

Upvotes: 0

Dewfy
Dewfy

Reputation: 23624

Ctrl-F5 - forcible way to reload in IE

Upvotes: 4

Related Questions