hi i have a little problem
i uploaded a new version of my website. and some users complained that they see some page i changed very very wrong.
anyway after a refresh they see it fine.
i think its because my css file got cached by them on an earlier time... why isnt the browser downloading the css file by himself on first load?..
he should know the css file changed dosnt he?
thanks in advance
Not necessarily. If your css files have been sent from the server with a max-age directive and/or an expiring date far in the future, browser are instructed to not make conditional requests to your resource (see http://developer.yahoo.com/blogs/ydn/posts/2007/05/high_performanc_2/) so they consider the resource in cache still valid.
In this case in order to force a new request you may need to rename the file or append a random querystring like
file.css?848372034
or, even better, a version note likefile.css?v=1
If you install the web developer toolbar (for Firefox or IE) you can disable cache. I use this when developing websites. It saves you having to rename your CSS every time you make a minor edit.
If you're on Apache try adding this in your root .htaccess:
Include only file types you don't want cached , eg:
If you know when you want to change files, set a future date - your site will be faster if these files are not regularly refreshed.
If you don't set an expiry date, browsers cache these files in proportion to their age.
@UpTheCreek's method will work fine. But you can save some trouble by just changing the call and not changing the filename.
This will also force a reload but will only require you to change the call.