No mention of server push, so I assume it's not supported?
How would server push from a web server work?
Apache 2.4.17 with HTTP/2 support
21–29 of 29 posts
Re: Apache 2.4.17 with HTTP/2 support
#22No mention of server push, so I assume it's not supported?
How would server push from a web server work?
ServerPush /static/css/main.css
ServerPush /static/js/main.js
ServerPush /static/img/gigantic-homepage-image.jpg
ServerPush /static/js/leaflet.js
I believe this could even avoid the need to include cache-busters in the URL since you could push with an ETag and the client can terminate if it already has the appropriate bytes without the incredible performance hit of using ETags with HTTP 1.Re: Apache 2.4.17 with HTTP/2 support
#23No mention of server push, so I assume it's not supported?
How would server push from a web server work?
Another method would be to add a headers to the response:
Server-Push: /relative/url
Then have an output filter pull them out and push them -- but AFAIK the APIs to do that don't yet exist in mod_h2 to push like that. Adding headers in the response is nice because it works with any 'backend', and the web server doesn't have to parse the HTML/css/etc going the through it.Re: Apache 2.4.17 with HTTP/2 support
#24No mention of server push, so I assume it's not supported?
Re: Apache 2.4.17 with HTTP/2 support
#25No mention of server push, so I assume it's not supported?
Re: Apache 2.4.17 with HTTP/2 support
#26Earlier quoted context omitted.
How would server push from a web server work?
The simplest way would seem to be a directive to push static resources: ServerPush /static/css/main.css ServerPush /static/js/main.js ServerPush /static/img/gigantic-homepage-image.jpg ServerPush /static/js/leaflet.js I believe this could even avoid the need to include cache-busters in the URL since you could push with an ETag and the client can terminate if it already has the appropriate bytes without the incredible…
Jetty's approach to this problem is really interesting. Using HTTP referrer headers, it builds up a tree of resources that are often fetched together. Then, it optimistically pushes companion resources down. https://github.com/eclipse/jetty.project/blob/master/jetty-s...
Re: Apache 2.4.17 with HTTP/2 support
#27Earlier quoted context omitted.
The simplest way would seem to be a directive to push static resources: ServerPush /static/css/main.css ServerPush /static/js/main.js ServerPush /static/img/gigantic-homepage-image.jpg ServerPush /static/js/leaflet.js I believe this could even avoid the need to include cache-busters in the URL since you could push with an ETag and the client can terminate if it already has the appropriate bytes without the incredible…
I think this is unsustainable (any non-trivial change to your html resources would require updating and restarting httpd). This is not DRY. Jetty's approach to this problem is really interesting. Using HTTP referrer headers, it builds up a tree of resources that are often fetched together. Then, it optimistically pushes companion resources down. https://github.com/eclipse/jetty.project/blob/master/jetty-s...
The Jetty approach is clever, too, as would be things like scanning rel=prefetch links but simple declarative approaches have their moments, too. One thing the Jetty approach doesn't appear to offer is the ability to manage resources if not all resources are appropriate for every client so it would appear to do things like ship every size of a responsive image to every client.
Re: Apache 2.4.17 with HTTP/2 support
#28Earlier quoted context omitted.
How would server push from a web server work?
Other comments are are good starts. Another method would be to add a headers to the response: Server-Push: /relative/url Then have an output filter pull them out and push them -- but AFAIK the APIs to do that don't yet exist in mod_h2 to push like that. Adding headers in the response is nice because it works with any 'backend', and the web server doesn't have to parse the HTML/css/etc going the through it.
[1]: https://code.google.com/p/mod-spdy/wiki/OptimizingForSpdy#Us... [2]: https://github.com/GoogleChrome/http2push-gae
Re: Apache 2.4.17 with HTTP/2 support
#29No mention of server push, so I assume it's not supported?
Here's a blog post I wrote about why this probably isn't implemented in most servers yet: https://caddyserver.com/blog/implementing-http2-isnt-trivial
First, push is very different than inlining, because individual resources are cacheable by the client, and inlined resources are not. There's a little handshake at the start of a push and if the client has (or doesn't otherwise want) the resource, it can cancel the push.
In my team's experiments with using push for HTML Imports, push ends up being better than inlining (using Polymer's vulcanize tool), even with a cold cache.
Also, push is relatively easy to implement if you use the response header approach, and was availably early on in mod_spdy.