So I'm trying to update my site's pdf forms, but when I changed them in my server, my users only see the old forms.
Is there a way to automatically force them to refresh the cache so they will see the new files?
In most browsers on PC and Mac, you can perform a simple action to force a hard refresh. Hold down the Shift key on your keyboard and click on the reload icon on your browser’s toolbar. There are also keyboard shortcuts to perform the equivalent hard refresh. Because there are multiple ways to do the same action, they will be listed below:
By adding a unique number after ?id= and incrementing it for new changes, users do not have to press CTRL + F5 to refresh the cache. Alternatively, you can append hash or string version of the current time or Epoch after ?id=
Safari for iPhone and iPad: There is no shortcut to force a cache refresh. You’ll have to dig into settings to erase your browser’s cache. After you perform the hard refresh, you should see the web page go blank, and the reloading process will take longer than usual.
If they never contact your sever there really is nothing you can do about it. The browsers are using the cache for optimizing calls to the servers, in the case of any update of your build production you have to force browser to refresh resources from the server just like use f5 to clear the cache.
You can't force user's browser to clear cache from your website. Just change your pdf name and update it's link in your html accordingly when you replace it. This will prevent browsers from loading it from cache.
For instance, if you have a file named form1.pdf and want to replace it with updated version, delete form1.pdf (don't simply replace), name your new file a different name like form1a.pdf & update existing link to point to form1a.pdf.
Please check if you have caching for your static files on the server (is there some kind of CDN like Cloudfront is used? If yes then it could be checking for updates files once in a given period only).
You may also may control caching on the server-side by sending the Cache-Control
header to no-cache, must-revalidate
(see this for more options)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With