Home > php教程 > php手册 > ajax2—解决缓存问题—php(28),ajax2缓存

ajax2—解决缓存问题—php(28),ajax2缓存

WBOY
Release: 2016-06-13 09:03:55
Original
1099 people have browsed it

ajax2—解决缓存问题—php(28),ajax2缓存

五、ajax快速入门

ajax代码:

 

Php程序:

Php代码:

ajax计算两个数的和

七、解决缓存问题

以上的问题:

将php中的加法改成减法

如果用之前的请求参数,发现仍然是加法,如果是新的请求参数就是减法运算。

解决方法1:  随机数

Math.random(); 

解决方法3、  设置请求头

setRequestHeader("If-Modified-Since","0");

解决方法4、  设置响应头

header("Cache-Control: no-cache, must-revalidate");

 

 

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