Reputation: 1769
How can I make an AJAX call in ReactJS with out caching the json data?
this.serverRequest = $.get(this.props.source, function (result) {
console.log("after serverRequest");
}.bind(this));
Upvotes: 0
Views: 69
Reputation: 1182
It's a setting on jQuery Ajax:
Globally:
$(document).ready(function() {
$.ajaxSetup({ cache: false });
});
or per request:
$.ajax({
cache: false,
url: "/path/to.json",
dataType: "json",
success: function(data) {
...
}
});
Upvotes: 1