PHP文件为什么会有缓存,并且只有在谷歌

WBOY
Release: 2016-06-13 11:57:14
Original
957 people have browsed it

PHP文件为什么会有缓存,而且只有在谷歌
SingleLink.class.php

<br /><?php<br />class Hero{<br />    private $id;<br />    private $name;<br />    private $nickname;<br />    private $next = null;<br />    public function getId() {<br />        return $this->id;<br />    }<br /><br />    public function setId($id) {<br />        $this->id = $id;<br />    }<br /><br />    public function getName() {<br />        return $this->name;<br />    }<br /><br />    public function setName($name) {<br />        $this->name = $name;<br />    }<br /><br />    public function getNickname() {<br />        return $this->nickname;<br />    }<br /><br />    public function setNickname($nickname) {<br />        $this->nickname = $nickname;<br />    }<br /><br />    public function getNext() {<br />        return $this->next;<br />    }<br /><br />    public function setNext($next) {<br />        $this->next = $next;<br />    }<br /><br />    function __construct($id="",$name="",$nickname=""){<br />        $this->id = $id;<br />        $this->name = $name;<br />        $this->nickname = $nickname;<br />    }<br />}<br />?><br />
Copy after login

test.php
<br /><?php<br />header("Cache-Control: no-cache, must-revalidate");<br />require_once 'SingleLink.class.php';<br />$head = new Hero();<br />$hero = new Hero(1,"宋江","及时雨");<br />echo $hero->getName();<br />?><br />
Copy after login





第一次运行并不是缓存,运行结果是”宋江“。我把 $hero = new Hero(1,"宋江","及时雨"); 改成 $hero = new Hero(1,"宋江222","及时雨"); 运行结果还是”宋江“。网络分析是显示上图的frome cache。这个是谷歌的运行结果。IE下是正常的,第二次运行结果是”宋江222“。
高手帮忙分析一下,为什么CHROME会出现这种缓存。

------解决方案--------------------
如果缓存是 php 造成的,那么不管是什么浏览器都会有缓存
而你只是在特定的浏览器上出现缓存,显然与该浏览器设置有关
当然也不排除他不能响应你阻止缓存的指令

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template