脚本宝典收集整理的这篇文章主要介绍了AJAX防止页面缓存的代码,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
采用AJAX技
术的时候&nbs
p;通常我们无刷新页面提交数据后 用同样的url去获取数据的时候会发现是以前的数据~那样就给client端带来假象了~~ 采用以下的方法可以取消缓存
htm网页
<
;metahttp-equiv="
PRagma"content="no-cache">
<metahttp-equiv="cache-control"content="no-cache,must-
revalidate">
<metahttp-equiv="e
xpires"content="wed,26feb199708:21:57gmt">
或者<metahttp-equiv="expires"content="0">
asp网页
response.expires=-1
response.expiresabsolute=now()-1
response.cachecontrol="no-cache"
php网页
header("expires:mon,26jul199705:00:00gmt");
header("cache-control:no-cache,must-revalidate");
header("pragma:no-cache");
jsp网页
response.addHeader("pragma", "no-cache");
response.addHeader("cache-control", "no-cache,must-revalidate");
response.addHeader("expires", "0");
脚本宝典总结
以上是脚本宝典为你收集整理的AJAX防止页面缓存的代码全部内容,希望文章能够帮你解决AJAX防止页面缓存的代码所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。