I'm developing a app with PhoneGap/Cordova 2.5.0 and I'm making AJAX calls with jQuery 1.8.2 to retrieve datas from an external server. I'm doing a lot of requests and I can see my app cache growing up, and this is not pretty cool...
I've tested many things like :
$.ajaxSetup({
cache: false,
headers: {
"Cache-Control": "no-cache"
}
});
OR / AND
var ajaxRequests = {}; // Limit one AJAX call for each "data_id" to prevent numbers calls
if (vrbd.ajaxRequests[data_id] === undefined) {
ajaxRequests[data_id] = $.ajax({
type: 'GET',
dataType: 'xml' + data_id,
url: url,
data: {
_: new Date().getTime() + Math.random()
},
async: true,
timeout: (data_count >= 2 ? data_count * 800 : 2000),
cache: false,
headers: {
"Cache-Control": "no-cache"
}
})
.done(function(data, textStatus, jqXHR) { ... })
.fail(function(jqXHR, textStatus, errorThrown) { ... })
.always(function(jqXHR, textStatus) { delete ajaxRequests[data_id]; });
}
If I let my app running during a couple of hours, I can see my cache growing up from about 160kb to about 30Mb in Settings > Apps > MyApp > Cache (AVD and real device).
So, didn't I understand anything about the cache in Settings or did I forget something ?
Please, let me know if you need another informations, sorry for my english, and thanks in advance for your help.
Best regards Alex