Reputation: 305
I have made a simple web-page including a couple of static pages, a css file, and a couple of images.
After I changed the css the page looks strange for those who cached the page from earlier visits.
After googling I realized that there are at least two different techniques to force visitors to load the page (found here):
Do not allow the user to store the data in cache at all:
Refresh the page after a certain time interval:
Are there better ways?
Thanks!
Upvotes: 0
Views: 2388
Reputation: 351
Put a query string on your link rel tag and change it each time you update your css
in short
<link rel="stylesheet" xhref="http://www.yoursite.com/style.css?version=1" type="text/css" />
change to
<link rel="stylesheet" xhref="http://www.yoursite.com/style.css?version=2" type="text/css" />
when you update your css.
Don't know about best but this way it's only refreshed every time your css changes.
Upvotes: 2