I just uploaded some revised pages to my site. When I went to view them online, the older pages displayed instead of the new ones - since the older ones were in my browser cache (same thing happens in both I.E. and Firefox). Going into I.E.'s Tools menu and deleting Temporary Internet Files fixes the problem on my machine, but if Joe Blow viewed my site recently, then checks again today, he's seeing the older versions - correct? So my question is, is there something I can do to my pages to force browsers to always display the latest version? Or is this something that can only be done locally by a visitor to the site (who, of course, won't have a clue that he's looking at an obsolete page and needs to delete his cache)?
In .htaccess file:
Header append Cache-Control must-revalidate
This makes HTML files to expire in 1 second. You can add css, js etc in the first line if you wish.
Times that you can't access your website's .htaccess, a simple meta tag within your HTML file should work - but, be aware that this will work only when your user's existing browser has visited this file (with the meta tag in it).
Read this solution on StackOverflow: http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off -caching-in-all-browsers
no-cache meta tag has been around for a long time and may be that's enough for some cases, however it's worth noting:
The .htaccess file seems to be working. I set the time to 6 hours; that way, nothing gets reloaded during a given browser session - but if a visitor comes back after revisions have been made he'll be seeing the revised files.