I have a ajax call to a controller that is supposed to send me an updated view back so that I can update my page with the updated data. But I get 304: Not Modified header back.
I tried a to use the no-cache option for the ajax call, and tried to manually add a timestamp to the end of request url as well, non of them worked on IE9.
This works perfectly on chrome without setting the caching option.
I am not too sure where the problem is.
The following is the code I used, which I thought worked after manually adding the timestamp. QA said it doesn't work on her computer.
$.ajax({
url: form[0].action + "?cc="+new Date().getTime(),
type: 'POST',
cache: false,
data: $(form).serialize()
})
.success(createFilterCleanup);
Try setting the following in your JQuery $.ajax, to prevent IE from caching your ajax requests. This has always worked for me.
$.ajaxSetup({ cache: false });
OR
$.ajax({ type: 'POST', cache: false });
http://api.jquery.com/jQuery.ajax/
"If set to false, it will force requested pages not to be cached by the browser. Setting cache to false also appends a query string parameter, "_=[TIMESTAMP]", to the URL. "
Below is an article with some other possible solutions: http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/
Hopefully this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With