各位大神下午好,我从书上看到header("Cache-Control:no-cache")可以强制浏览器不使用缓存,所以想着试验一下效果,代码如下:
<?php
header("Pragma:no-cache");
header("Cache-Control:no-cache,must-revalidate");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<img src="1.jpg" alt="">
</body>
</html>
但是却没有看到预期的效果,每次刷新页面都返回304,为什么不是200呢?
真是猜不透。。。
html 不是 200 了么。。
jpg 是静态文件,根本不走 php 在 apache/nginx 就返回了,缓存也是服务器处理的。