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

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -