Fetch keeps returning same results even after changing url

From some days ago fetch function in my code keeps returning the data from a url which I already changed in the request. I returns always same data and error “Already read” irrespectivelly of which url I put in. Here’s the code:

var Observable = require(“FuseJS/Observable”); var dataE = Observable();

fetch(‘http://www.mydomain.com/api/get_category_posts/?category_id=40’) .then(function(response) { console.log("Events: "+JSON.stringify(response.json())); return response.json();}) .then(function(responseObject) { dataE.value = responseObject;}) .catch(function(err) { console.log(“it’s an Error @ events”); console.log(err.message); });

Why could this strange behaviour be???.. How do I trace the problem?

Fuse respects the cache headers from your server, so if they tell us to cache, we will. So I would start by looking at them. You can do a small hack if you can’t control it, by adding a “random” seed:

var seed = '&' + new Date().getTime().toString();
fetch('http://www.mydomain.com/api/get_category_posts/?category_id=40' + seed)
.then(function(response) { console.log("Events: "+JSON.stringify(response)); return response.json();})
.then(function(responseObject) { dataE.value = responseObject;})
.catch(function(err) { console.log("it's an Error @ events"); console.log(err.message); });