lightning-framework / lightning

A simple yet expressive Java web framework.
5 stars 0 forks source link

Add HTTP/2 push support. #5

Open mschurr opened 8 years ago

mschurr commented 8 years ago

See: https://github.com/AndreasKl/embedded-jetty-http2/blob/master/src/main/java/net/andreaskluth/Application.java https://github.com/eclipse/jetty.project/blob/master/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java https://webtide.com/jetty-http2-cleartext-upgrade/ http://stackoverflow.com/questions/31642015/embedded-jetty-http-2-not-working-with-firefox-chrome-but-seems-ok-with-safari http://www.eclipse.org/jetty/documentation/current/http2-configuring-push.html http://stackoverflow.com/questions/35162252/how-to-do-server-push-with-standalone-jetty https://github.com/eclipse/jetty.project/blob/master/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/PushCacheFilter.java

mschurr commented 8 years ago

HTTP/2 support added in 15e038750d231755f8cfd3fa751515bcef8aae2a.

PushCacheFilter still needed to perform automatic pushing. An alternative (and probably better) idea is to let users specify paths to push by using the Pushes annotation to as well as exposing a push(path) API on lightning.server.Context.

mschurr commented 8 years ago

Low priority because this issue could be partially resolved by reverse proxies. Note that users can currently do this (hackily) by using Jetty's Request.getBaseRequest(request).getPushBuilder().