[ACCEPTED]-HTML link that forces refresh?-refresh

Accepted answer
Score: 11
  1. Change all the links to the page with a nonsense query parameter: products.html?happy=days
  2. Change all the resources on the page to use another nonsense query parameter: style.css?the=fonz

You can do it in a systematic way using 3 dates or timestamps or version numbers, or 2 haphazardly using sitcoms, muppets, mountain 1 ranges, and small mammals.

Score: 4

Add a url parameter to the end of the href 1 with a unique value, say new Date().getTime():

Score: 2

When I need to have a complete refresh of 13 the page, I simply add ?v= followed by a random 12 string of character. When a browsers detect 11 a query string after a page, they automatically 10 bypass the cache (if the same query string 9 is not present in the cached version), as 8 the content of the page could change depending 7 on the value of the query string.

Since a 6 web page can be reloaded more that once 5 by second, I use the current UNIX timestamp 4 followed by a letter and a random number 3 between 1 and 1000.

The chances that two 2 pages get exactly the same query string 1 are close to null.

Score: 0

Many people use a version query string parameter.

Check 5 out the SO source

<script type="text/javascript" src="http://sstatic.net/so/js/master.js?v=4143"></script>

Specifically notice the 4 master.js?v=4143

Personally, I set this in my config file 3 which is application wide, but I believe 2 you can do this right in your source control 1 if you need more granular automatic versioning.

Score: 0

HTML link that forces refresh with javascript 1 :

<a href="javascript:location.reload();"  
  class="btn btn-sm btn-info"><span class="fa fa-refresh"></span></a>
Score: 0
window.location.assign("home.html") --- Hard Reload to given url;
window.location.reload()            --- Hard Reload current url;


More Related questions