I have a form on which I do a POST to a webservice. Behind the submit button of the form I have this jquery code:
$("#msform").submit(function (e) {
$.ajax({
url:'https://example',
type:'POST',
data:formData1,
crossDomain: true,
dataType: 'json',
jsonpCallback: 'callback',
success: function(data) {
console.log(data);
}
});
});
Now this code used to work, but when I changed my cache control it seemed not to work..
In my html I have this code for cache control:
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
I added this cache control because I want the users to see new changes on the website whenever uploaded. In the past they needed to click CTRL+F5 to see the new changes or to use the new javascript.
In the past, when AJAX worked, I had this line: which I changed to:
Now when the user submits the form the post will not be received. But if the user goes back to the form page and submits the data again, then the post will be received.
Are there any ways to not save cache but continue doing AJAX Posts?
--edit
I removed the ajax post and substituted it to a php post