Click t...">

Refresh the page by clicking on the link

I have the following to refresh my page when I click on href.

<a href="javascript:history.go(0)">Click to refresh the page</a> 

I have it

  <meta http-equiv="no-cache"> 

in the title tag. Even then I get a cached copy. How can I avoid downloading a cached copy?

+7
html browser-cache
source share
5 answers

instead

 javascript:history.go(0); 

you can use

 javascript:window.location.reload(); 
+11
source share

The <meta> missing a content attribute. try it

 <meta http-equiv="expires" content="0" /> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="expires" content="-1" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="cache-control" content="no-cache" /> 

You can also try

 <a href="javascript:window.location.reload();"> 

but I'm not sure how this works with caching

+2
source share
 <a onclick="window.location.href=this">test</a> 
+2
source share

Try the following:

  <a class="refresh_link" href="javascript:void(0)">click to Refresh the Page</a> <script type="text/javascript"> $(document).ready(function(){ $(".refresh_link").click(function(){ location.reload(); }); }); </script> 

Used by jquery

+1
source share

try it

 window.location.href=window.location.href 
0
source share

All Articles