Home  >  Article  >  php教程  >  屏蔽浏览器缓存另类方法

屏蔽浏览器缓存另类方法

WBOY
WBOYOriginal
2016-06-21 09:04:26952browse
有时候我们不希望浏览器使用缓存加快网页的显示,尤其是那些论坛之类的频繁更新内容的网页,在网上有说可以使用下面的方法来屏蔽缓存,但是我试了效果不好。

  

  某日我突发奇想,找到了一种在任何情况下都会显示最新的网页内容的方法,描述如下:

  请将网页的链接改为:

  http://xxx.yyy.zzz/page.php?rand=XXXXXXX

  其中http://xxx.yyy.zzz/page.php是你的网页,rand是一个你不会用到的Qurey字串,XXXXXXX是一个随机字串。

  也就是说,只要在链接的Url加入了一个不会影响网页的内容的随机字串,从而使得每次访问该网页的Url都不同,从而可以使浏览器不使用缓存中已有的该网页,而使每次显示的都是最新的内容。



Statement:
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