How to prevent caching from jQuery Ajax?

Posted by cynwong on Stack Overflow See other posts from Stack Overflow or by cynwong
Published on 2010-06-09T00:46:10Z Indexed on 2010/06/09 0:52 UTC
Read the original article Hit count: 527

Filed under:
|
|

Hi,

Could anyone please help me with this? I have a web page using .manifest for offline storage caching. In that page, I use jQuery ajax call to get the data from the server. If I first load the page, it is OK. I can switch between Online and Offline. But the problem is when I go back online and refresh the page. jQuery ajax cannot be able to talk to server anymore. Is there a way to for ajax to talk to the server or clear offline cache?

My ajax call is as such:

        $.ajax({

            type: "GET",

            url: requestUrl,
            success: localSuccess,

            error: error,

            dataType: "text",
            cache:false
        });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX