【问题标题】:Spring Boot HTTP2 Server PushSpring Boot HTTP2 服务器推送
【发布时间】:2017-08-31 15:02:49
【问题描述】:

从 Brian Clozel 那里找到了关于 HTTP/2 和 Spring Boot 的很好的例子,尤其是服务器推送:https://github.com/bclozel/http2-experiments。 有一个index.html 有一些图像资源。但是,这些图像被推送到服务器,但我不知道这个推送到底是从哪里发起的。我没有看到任何推送过滤器或任何其他可能导致将资源推送到index.html 中的指标。有什么想法吗?

【问题讨论】:

标签: spring spring-boot http2


【解决方案1】:

示例中,Jetty 的PushCacheFilter 配置为here

PushCacheFilter 将自动“了解”与任何资源关联的辅助资源,并自动推送它们。

该示例还显示了programmatically push a resource 的方法。 但是,该 API 已被弃用,取而代之的是使用 PushBuilder

PushBuilder 将成为 Servlet 4.0 的一部分,成为标准 API。

【讨论】:

    猜你喜欢
    • 2016-06-14
    • 2015-06-03
    • 2019-08-11
    • 1970-01-01
    • 2016-10-24
    • 2016-10-18
    • 2020-03-07
    • 2016-09-01
    • 2017-12-13
    相关资源
    最近更新 更多