iOS6 - 有没有办法来清除Web应用程序添加到主屏幕缓存AJAX POST请求?

问题描述:

iOS6 AJAX POST请求缓存成为我们的Web应用程序的一大问题。我们的大多数用户已添加应用程序到主屏幕。自从升级,大部分的POST请求到后端都没有工作,数据来自超过6天前计数陈旧。我们知道两种解决方法解决这个问题,一个是要改变每一个POST请求,以便它是通过添加时间戳或一些随机输入给它不同的,第二个是要禁用Web服务器缓存。

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.

这两种解决方法详见以下职位: 是Safari浏览器在iOS 6缓存$阿贾克斯的结果?

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

关闭缓存上的Web服务器将解决这个问题,如果它是在iOS6升级(或右后)之前设置。然而,似乎自从升级以后发生直到我们把从添加到主屏幕上的应用程序缓存关闭的时候,仍然缓存任何POST请求!我们无法找到一个方法来清除它们。除去主屏幕应用程序,并重新启动设备不会做的伎俩!我们唯一的选择就是改变我们的网址,或者在另外一个时间戳添加到每个请求关闭缓存上的网络服务器。

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!

在我的经验consitently打败这个缓存问题的唯一途径是采取谷歌的做法,每个请求ID的URL添加。然后,您可以使用mod_rewrite或其他此类引擎为您的服务器,使这个透明的后端脚本。

The only way to consitently beat this cache problem in my experience is to take Google's approach and add a per request id in the url. You can then use mod_rewrite or another such engine for your server to make this transparent for your backend scripts.