Chrome Is Caching An Http Put Request
I have this bizarre issue with Chrome. It quite often appears to cache PUT requests. The Details: I have an app using backbone.js and when trying to persist some changes to a model
Solution 1:
I use extra parameter to avoid caching:
url += '?_dc=' + Math.random().toFixed(20).replace('.', '');
I don't interpret this parameter on server side.
EDIT: Besides of chrome there are a lot things could cache requests - user's proxy server for instance. I think additional query parameter is a good solution to keep out of caching.
Solution 2:
Backbone use jQuery or Zepto to make the AJAX request. Assuming that you are using jQuery, set the cache off.
Run this to set the cache off in the overall application so you will not need to worry about cache:
$.ajaxSetup({
cache : false
});
If keep the cache on is important for your business, I think that you could do something like this for specific no cache calls:
model.save({}, {cache:false});
Post a Comment for "Chrome Is Caching An Http Put Request"