This is the statement which I am referering the below code $.ajaxSetup ({ cache: false});
I have a PHP script which produces JSON. I am consuming this json using:
$.getJSON ("GetDetails.php?id=123",
$("#formname").serialize(),
function(data){
**$.ajaxSetup ({ cache: false});**
//I do all processing with the "data"
});
I have seen various questions for caching in the stack overflow I know this also removes the caching
- $.ajaxSetup ({ cache: false});
- By appending Time
Are there any methods to overcome the Cache. When I use this, it is still caching. I have used the same statement in $.documnet.ready() , but no use.
That
$.ajaxSetup()call goes before your usage of AJAX methods you want to be affected by it (you just need to run it once, not before every call), like this: