Search code examples
browserquery-stringbrowser-cache

Can unique query string in the URL prevent website being cached in the browser?


There are many occasions where my client sees a cached version of the website from the link I shared to them. After a while it can become very frustrating to make sure they're not seeing a cached version of the website. Are there ways out there to avoid this?

I often times have to ask them to clear their browser cache and point them to online how tos in how to clear their respective browser's cache.

I am testing a hack where I use query string to produce a unique URL. It's not being processed in the server, the query string is simply there to have a unique url every time I share it. It's currently working in my browser and to people I've shared but I'm not sure if it's a bulletproof solution.

For example:

http://examplesite.com/index.php?v=25

http://examplesite.com/index.php?d=09282017


Solution

  • This is a generally accepted practice to force the browser pull down the latest copy of the content yes.

    This will not prevent the browser from caching other resources that this page requests, for example seperate css or JavaScript files.