【问题标题】:HTTP/2 Server pushed but it's reloaded the pushed file on Apache2.4HTTP/2 服务器推送但它在 Apache2.4 上重新加载了推送的文件
【发布时间】:2017-08-22 20:07:25
【问题描述】:

我只是设置了一个 Apache 2.4 服务器并使用 http/2。 我在服务器中配置了服务器推送:

Protocols h2 http/1.1
            DocumentRoot /var/www/html/
                    <Location /index.html>
              Header add Link "</img/2.jpg>; rel=preload"
             </Location>

但是服务器推送了它,但它仍然加载了这张图片, enter image description here

希望有人可以帮助我:)。非常感谢

【问题讨论】:

    标签: apache ubuntu http2


    【解决方案1】:

    我刚刚找到了导致它不起作用的原因,当我们使用服务器推送时,比如 css、image、js...

    我们需要确定我们推送的文件。

    Protocols h2 http/1.1
            DocumentRoot /var/www/html/
                    <Location /index.html>
              Header add Link "</img/2.jpg>; rel=preload; as=image"
             </Location>
    

    【讨论】:

      猜你喜欢
      • 2017-09-06
      • 2020-05-19
      • 2019-10-10
      • 2020-08-24
      • 2017-04-06
      • 2020-04-23
      • 2017-12-28
      • 2011-08-17
      • 2020-03-24
      相关资源
      最近更新 更多