如果用户有缓存在其浏览器中的文件,他们发送带有如果修改 - 因为
标题中的http请求,是有办法来自动为他们服务一个 304未修改
反应使用的.htaccess?
If a user has a file cached in their browser and they send a http request with an If-Modified-Since
header, is there a way to automatically serve them a 304 Not Modified
response using .htaccess?
这是间接的解决方案:
的.htaccess:
.htaccess:
RewriteCond %{HTTP:if-modified-since} .
RewriteRule . /not_modified.php [L]
not_modified.php:
not_modified.php:
header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified');