您好,欢迎访问一九零五行业门户网

php header缓存的示例

每5秒更新.. adminers ?php$interval=5;session_cache_limiter('private_no_expire'); //在session之后处理缓存, 需要加上这个.session_start();if ($_server['http_if_modified_since']){ // http_if_modified_since即下面的: last-modified,文档缓存时间. /
每5秒更新.. adminers time()){ header('http/1.1 304 not modified'); exit(); }}// 上面这段代码未使用任何其它库, 所以可以放在首行. header(pragma: private);header(cache-control:max-age=$interval, pre-check=$interval); header(expires: . gmdate(d, d m y h:i:s,time()+$interval). gmt);header(last-modified: . gmdate(d, d m y h:i:s) . gmt); echo date('y-m-d h:i:s'); // 注意看是不是差5秒刷新一次.echo ' - link
';var_dump($_server['http_if_modified_since']);// ie11 ff38 chrome测试通过.
其它类似信息

推荐信息