我想使用以下代码为我的页面启用缓存控制:
<?php
$expires = 60 * 60 * 24 * 14;
header("Pragma: public");
header("Cache-Control: maxage=" . $expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
?>
<!DOCTYPE html>
<html lang="en">...
我已经在页面的乞讨时添加了它,但它不起作用,我得到了这个回复:
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:40256
Content-Type:text/html
Date:Fri, 28 Mar 2014 18:57:59 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=5, max=100
Pragma:no-cache
Server:Apache/2.4.6 (Ubuntu)
Vary:Accept-Encoding
X-Powered-By:PHP/5.5.7-1+sury.org~precise+1
问题出在哪里?