i'm developing a mobile app using cordova . The app consists on sending AJAX requests to a php script on a distant server and then the php extracts the required data from a database and responds with these data in JSON format so the app can parse these data and show them on the app . The problem here is that I have to send the AJAX calls again every time i open the app or browse between the different pages of the app .
here is the function that requests the data :
$.ajax({
crossDomain: true,
type: "GET",
async: false,
url: "www.website.com/get-data.php?offset=8&&categorie=all ,
dataType: "json",
cache: true,
success: function (data) {
//function to call if success callback
}
});
Is there any solution to cache the data or save them some how to prevent unecessary use of the internet connection and the waste of time waiting for the server's response ?
thanks for answering .