Apache:http2推送资产加载了两次

时间:2017-09-12 15:31:14

标签: php apache http http2

我已经使用http2。

配置了一个Windows Apache Web服务器

我启用了模块

LoadModule http2_module modules/mod_http2.so

在虚拟主机中我添加了:

<VirtualHost *:443>
    <IfModule mod_http2.c>
      Protocols h2 http/1.1
    </IfModule>
...
</VirtualHost>

我在php中创建了这个示例页面:

<?php
   header('Link: </test.js>; rel=preload; as=script', false);
   header('Link: </test.css>; rel=preload; as=style', false);
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<script src="/test.js"></script>
</body>
</html>

但Chrome控制台告诉我这些文件已下载2次。

enter image description here

以下列出了服务器发送的标头。我使用Apache 2.4.25

enter image description here

这是正常行为吗?

这是正确的配置吗?

0 个答案:

没有答案