Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP上次修改的标题未发送?_Php_Http Headers_Last Modified - Fatal编程技术网

PHP上次修改的标题未发送?

PHP上次修改的标题未发送?,php,http-headers,last-modified,Php,Http Headers,Last Modified,因此,我在PHP文件的顶部有以下内容: <?php // Set headers header('Content-Type: text/html; charset=UTF-8'); header('Content-Style-Type: text/css'); header('Content-Script-Type: application/javascript'); header('HTTP/1.1 200 OK'); header('Content-language: en-US');

因此,我在PHP文件的顶部有以下内容:

<?php
// Set headers
header('Content-Type: text/html; charset=UTF-8');
header('Content-Style-Type: text/css');
header('Content-Script-Type: application/javascript');
header('HTTP/1.1 200 OK');
header('Content-language: en-US');
header('X-Powered-By: ');
header_remove('X-Powered-By');
header('Last-Modified: Tue, 01 Jan 2013 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');
header('Pragma: no-store, no-cache, max-age=0, must-revalidate');
header('Expires: Tue, 01 Jan 2013 00:00:00 GMT');
?>

因此,当我在我的站点URL上查看Firefox控制台的NET选项卡时,我没有看到最后修改的标题。有什么建议吗?

您告诉浏览器不要缓存任何内容,他必须重新验证所有内容。因此,最后修改的标题无关紧要。

您可以发布标题响应吗?这里是:为了公平起见,您告诉浏览器不要缓存任何内容,他必须重新验证所有内容。所以最后修改的标题不重要。哦,现在我明白了!我真傻!谢谢将此作为答案发布,以便我可以接受。请确保在.htaccess文件-1中没有未设置上次修改的标题。浏览器是否必须重新验证资源并不重要。我在这里研究了如何在HTML有无缓存策略的情况下获取该标头,因为我在AJAX请求中使用它。但还是没有运气。