Thursday, November 13, 2008

how to force browser to download new stylesheet

Stefan Hayden » CSS Caching Hack

http://www.stefanhayden.com/style.css?version=1

"What does ?version=1 mean? This is what a URL looks like if it’s passing a GET variable from one page to the next. To the browser it means the page is dynamic and it needs to get a new version because code may have changed. The browser has no way of knowing if the CSS file is actually dynamic or not.The trick is to change the number each time you update the CSS file to make sure the browser always downloads the new code."

No comments: