Ive found this tricky to word so please bear with me.
When I’m updating a website and I ask the client to see the changes, they always see the cached result from last time. Now this isn’t a problem as I can ask them to ctrl f5 to refresh all the cache.
My question is, is there a way that I can force the client browser to refresh all of the content automatically? and what is the usual standard on this? I want to still use cache as this speeds up the website, just be able to tell it when it has updated.
I know for javascript files and css files you can change the name of the file so the browser treats it as a new file and re-downloads it e.g. myCssFilev1.2.css but what about the actual HTML?
There are a couple of meta tags to do this:
The cache-control, expires and pragma settings all work in different browsers, so it’s best to include all of them. That should solve your problem.
EDIT
As Ariel has noted, you have to be careful with this. If this is a high-load situation, you probably want to find another solution. You can try to find the “middle ground”, but tweaking the parameters (setting expires or cache-control’s max-age to some value). However, if you don’t have an insane server load, then this should be fine.