prevent的iOS 6从缓存Ajax的POST请求 [英] Prevent iOS 6 from Caching Ajax POST Requests

查看:147
本文介绍了prevent的iOS 6从缓存Ajax的POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  是Safari浏览器在iOS 6缓存$阿贾克斯的结果?

我有一个正常运行在Android和iOS的混合应用程序中使用的PhoneGap 。但是,当我在的iOS 6开始测试我注意到,我没有收到服务器的数据,我的大多数AJAX调用 - 而不是我正从previous Ajax调用缓存中的数据。

I have a hybrid application using PhoneGap that runs fine on Android and iOS. But when I started testing in iOS 6 I noticed that I am not getting server data for most of my ajax calls - instead I was getting the cached data from previous ajax calls.

到目前为止,我已经尝试了以下选项来禁用缓存 -

So far I have tried the following options to disable cache -

  1. 在包括时间戳作为查询字符串参数
  2. $ ajaxSetup({缓存:假});
  3. 在Ajax调用无缓存=真
  4. $。阿贾克斯prefilter(功能(选项,originalOptions,jqXHR){     options.data =         。jQuery.param($扩展(originalOptions.data || {},{时间戳:新         。日期()的getTime()})); });
  1. Include a timestamp as query string parameter
  2. $.ajaxSetup({ cache: false });
  3. Inside the ajax call no-cache = true
  4. $.ajaxPrefilter(function (options, originalOptions, jqXHR) { options.data = jQuery.param($.extend(originalOptions.data||{}, { timeStamp: new Date().getTime() })); });

但这些似乎是工作。我调用Java类的行动从我的Ajax调用 - ?你认为这事做,为什么这些方法上面列出的失败原因

But none of these seems to be working. I am invoke Java action classes from my ajax calls - will it have something to do with the reason why the methods listed above are failing?

推荐答案

阅读这个线程

是Safari浏览器在iOS 6缓存$阿贾克斯的结果?

您可以禁用Web服务器级别,并使用时间戳在URL中的缓存。

You could disable the caching on webserver level and by using timestamps in the URL.

这篇关于prevent的iOS 6从缓存Ajax的POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆