Reputation: 39248
I am experiencing random occurrences of caching of Ajax requests created through Jquery's get.
The Jquery gets are done in the most straight forward conventional way (route + params + callback)
I am already using
$.ajaxSetup({cache:false});
But it doesn't seem to always work. I get how ajaxSetup no cache works, and I see the added random parameter being added to my request url.
My current browser is IE 8.0
Does anyone know of another solution besides the ajaxSetup way...
Upvotes: 0
Views: 300
Reputation: 39248
It turns out I was wrong about my assumption about caching of ajax requests. The real issue was caching of subsequent redirect to action requests that took place on the server (in response to the original ajax call). The solution ended up being the following attribute.
[OutputCache(Location = OutputCacheLocation.None)]
It can be either applied at the controller level or the action level.
Upvotes: 0
Reputation: 13877
The browser itself is simply not allowed/able to cache requests with distinct parameters, as added by {cache:false}
.
It sounds like the caching is happening somewhere else in your chain, possibly in your web server/app. Use firebug's net tab to check exactly what is being requested by the browser, and what the URLs are exactly, then take it from there.
Upvotes: 2