I have a strange problem with my app.
I have a PHP file on my server that echoes a JSON and I am fetching it from Android app.
If i change the PHP file, then also it gives the same JSON i dont know why and how.
If I fetch the file from browser, it displays correct JSON.
And now when i rename the file it displays the correct output.
I am fed up with this behavior.
Somebody please help.
This sounds a lot like a caching issue. There are number of different options you can try to bust the caching.
One method that pretty much always works is to place a random query string value to end of the URL. Something like a
timestamp is a good option as it is always new but a random string works too.
For example, if you URL was:
The new URL would be:
https://my.site/getJSON.php?t=<timestamp or random string>
Other options include adding
Cache-Control headers (and more) but the query string trick works and is easy to implement.