Home > php教程 > php手册 > body text

ajax缓存问题解决途径

WBOY
Release: 2016-06-13 12:35:06
Original
1094 people have browsed it

我用PHP和Ajax结合,添加数据之后,刷新前台页面,数据没有变化。
我改动PHP动态脚本,只有重新找开IE再输入地址,才能看到效果。
以上这些是不是缓存的原因啊?怎么解决?
ajax缓存问题解决途径:
是缓存的问题。
在服务端加 header("Cache-Control: no-cache, must-revalidate");
并且在你的JS提交参数中加随机或是时间字符串
url+"?timeStamp="+new Date().getTime();

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template