How to Clear Browser Cache using Javascript ? — Clear Browser Cache — ASP.Net Example
ASP.Net Example-How to Clear Browser Cache using Javascript ?

Monday, February 6, 2012

How to Clear Browser Cache using Javascript ?

This very Common Problem facing web developer. whenever user updating style sheet.
they need to press (Ctrl + F5) for clear browser cache.
 
Now if you are using any JavaScript file  then give name like
for i.e 
JavaScriptFileName.js?Math.random() 
<script type="text/javascript" 
src="http://hostname.net/js/JavaScriptFileName.js?Math.random()">
</script>
 
 
this is solution for clear browser cache.

1 comment:

  1. sweet, u just saved me loads of time... even had to reboot Windows 8, or shutdown Visual studio, and always press ctrl f5, and restart WCF services, and so on and so on...

    ReplyDelete

ASPdotNET-Example