Pull to refresh- New json data is not holding the latest data

Hi I am making a news website app. I am getting latest news by json call using http service.
Everything is working fine except pull to refresh. When I do the pull to refresh the corresponding function is working and json data is loading. But the new json data is not the latest data(I checked it in the network bar in chrome developer tool). Everytime I do the pull to refresh the same previous json data is loading again and again. But when I restart the application then I get the latest json data.
I am not sure why it’s not working? Let me clarify my problem again, every time http.get is called and return the json object when I do pull to refresh but the new json object is not holding the latest data?
Does Ionic cache the json object?
Should I have to programmatically refresh the json call from my service? If yes then how to do this?

Unless you tell it to cache the data it should not hold it for another pull. I would make sure that the call back is being fired at the right time… It would really help if you posted some of the code that you’re using to call the pull to refresh.

Requests are asynchronous, so if you’re trying to access the data before the request has finished getting it (i.e. calling the update function then using that variable right after that function in the code) it may not have had sufficient time to update it.

Post some code and I can help you debug it!

Finally I found the problem testing the same code with another wordpress site. My code is working fine with the new wordpress site. The problem is from my client’s website. I think the website forcefully caching the data into the respective device(In browser and mobile devices). When I disable cache from my chrome network tab then it works. I also set

{cache: false}

But it not works.
My browser don’t take any cache for my test website what is working fine.
Then I talked with my client and he said he is using cloudflare CDN for his website. Now I am thinking how can solve the problem?