在ios 6中使用jQuery ajax调用清除缓存 [英] clear cache in jQuery ajax call in ios 6

查看:78
本文介绍了在ios 6中使用jQuery ajax调用清除缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

i正在开发一个Web应用程序,当我在IOS 6版本的Safari浏览器上测试它时。每个请求都会获取相同的缓存结果。

是吗一个浏览器问题。如果它不能帮助我清除java脚本/ J查询中的缓存。



提前谢谢

解决方案

你有没有在ajax调用中明确地将cache设置为false?



 


< blockquote> .ajax({
url: test.html
缓存: false
成功:功能(数据){
// 一些处理
}
});









http://api.jquery.com/jQuery.ajax/ [ ^ ]


当你发出一个httpget请求时会发生这种情况。实际默认缓存设置为true。你需要使用以下属性:

将此属性应用于您的控制器或操作



 [OutputCache(Duration =  0 ,NoStore =  true )] 





这里缓存持续时间设置为0,nostore属性表示缓存数据不会存储在客户端。


Hi All,
i am developing an web application when i tested it on Safari browser in IOS 6 version.On every request its fetching same cache results .
Is it a browser problem.If it not help me in clearing the cache in java script/J query.

Thanks in advance

解决方案

Have you explicitly set cache to false in ajax call?


.ajax({ url: "test.html", cache: false, success: function(data){ //some processing } });





http://api.jquery.com/jQuery.ajax/[^]


It happens when you make a httpget request.actually by default cache is set to true .you need to use some attribute like:
apply this attribute to your controller or action

[OutputCache(Duration=0,NoStore=true)]



here the cache duration is set to 0 and nostore property says that cached data will not be stored at client side.


这篇关于在ios 6中使用jQuery ajax调用清除缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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