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.
This looks like the way to go, Kenneth - thanks.
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-brow sers
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:
- It's not a "right" approach and therefore this meta tag is not a valid HTML5 (and should fail when you validate)
- Therefore browsers may/should ignore it (although it may still work)
- It will not prevent caching other than at the browser level, i.e. you still receive a cached copy from proxy servers
- All other dependent files (scripts, styles, images etc) will still be cached
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.