I have once wrongly set as pragma: cache
header on my website, and now I have turned it back to Pragma: no-cache
, but I am still receiving reports that people don't see the updates on my site.
Is there any way to solve it?
It depends on what you want the users to see without force refresh. If it is the standard JS and CSS files. Do something like below -
JS
<script src="file.js?version=<?php echo $random_number;?>"></script>
CSS
<link rel="stylesheet" type="text/css" href="style.css?<?php echo $random_number;?>" />
Hope that helps.
I think no-cache is not enough.. add the following too.
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0">
<meta http-equiv="expires" content="Sat, 31 Oct 2014 00:00:00 GMT">
<meta http-equiv="pragma" content="no-cache">
You can use the code below to refresh or reload the currently loaded index page from a URL address entered directly into the browser's address bar, after a specific number of seconds, thereby forcing the browser to always reload the current document. In this case, the number of seconds has been set to 5:
<meta http-equiv="refresh" content="5" />
Please note that setting the number of seconds to 0 will cause the page to be automatically reloaded instantly, every time it is successfully downloaded.
Read this article too : Pragma: No-cache" Tag May Not Prevent Page from Being Cached