Thursday 28 November 2019

javascript - iOS6 - Is there a way to clear cached ajax POST requests for webapp added to home screen?

iOS6 ajax POST request caching is becoming a huge problem for our webApp. Most of our users have added the app to the home screen. Ever since the upgrade, most of the POST requests to the backend are not working and data is stale from over 6 days ago and counting. We are aware of two workarounds to resolve this, one is to change every POST request so that it's different by adding a timestamp or some random input to it, and the second is to disable caching on the webserver.




Both workarounds are detailed in the following post:
Is Safari on iOS 6 caching $.ajax results?



Turning off caching on the webserver would have solved the issue if it was set before the iOS6 upgrade (or right after). However, it seems any POST requests that were made since the upgrade and until the time we turned caching off from apps added to the home screen, are still cached! and we can't find a way to clear them. removing the home screen app and restarting the device doesn't do the trick! The only option we have is to change our URL or to add a timestamp to every request in addition to turning off caching on the webserver.



Does anyone know of a way to clear a home screen app cache, aside from restoring to factory? please provide details.



Warning to anyone who implemented a workaround by adding a timestamp to their requests without turning off caching on the server. If your app is added to the home screen, EVERY post response will now be cached and it doesn't seem to expire. Unless someone has a way to clear it, this looks like a potential memory leak!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...