Skip to content

IE: cache problems

February 26, 2011

When you are writing java scrips sometimes Internet Explorer cache problems occur. IE caches even ajax get responses.

To avoid it you need to change you javascript code in following way:

<br />
$(document).ready(function() {<br />
   /* you have to put the following line right after above line */<br />
   $.ajaxSetup({cache: false});<br />
   /* rest of the code */<br />
   ...<br />

If the method above didn’t solved out your problems you need to add additional parameter to each ajax GET request:

<br />
$.ajax({<br />
    type: &quot;GET&quot;;,<br />
    url: &quot;/customer/list&quot;,<br />
    data: { tstamp: new Date().getTime() }<br />
});<br />

From → javascript

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: