caching - Remove cache with javascript -


so javascript files being cached. had them in script tag so:

<script type='text/javascript' src='js/example.js'></script> 

now understanding is fine browsers cache get requests.

since application in development still can't allow now.

my second understanding caching if get query strings different wouldn't see them same therefore not caching them, in mind added pages instead:

<script type="text/javascript">     window.onload = function () {         var s = document.createelement('script');         s.type = 'text/javascript';         s.src = "js/example.js?timestamp=" + new date().gettime();         document.body.appendchild(s);     } </script> 

this loads file fine coming like:

<script type="text/javascript" src="js/example.js?timestamp=1369194644133"></script> 

but somehow still being cached.

i have cache disabled on browser (google chrome) still happening.

to serve files using iis 7.5 , have disabled cache site on well.

try use math.random()

 xhr.open('get', 'php/response.php?page=' + this.page + '&' + math.random(), true); 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -