Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot HTTP2 Server Push

Found the nice example from Brian Clozel about HTTP/2 and Spring Boot, especially with Server Push: https://github.com/bclozel/http2-experiments. There is an index.html which has some image resources. However, those image are pushed to the server, but I have no idea where exactly this push is initiated from. I don't see any push filters or any other indicators which could lead to push the resources inside the index.html. Any ideas?

like image 343
csnewb Avatar asked Apr 05 '17 20:04

csnewb


1 Answers

Jetty's PushCacheFilter is configured here in the example.

PushCacheFilter will automatically "learn" what secondary resources are associated to any resource, and will automatically push them.

The example also shows a way to programmatically push a resource. However, that API has been deprecated in favor of using a PushBuilder.

PushBuilder will be part of Servlet 4.0, becoming a standard API.

like image 51
sbordet Avatar answered Nov 15 '22 07:11

sbordet