ElixirConf 2017 - HTTP 2 Plug to Phoenix Cowboy too - @Gazler
In this talk, we will look at the changes in Cowboy 2 and how we can use it with Plug and Phoenix by using a custom Plug adapter. We will look at how this can be done using a library and integrating it with Plug. The same technique will be applied to Phoenix, writing a custom handler in a library and using it with Phoenix.
We will also explore how HTTP/2 can be used to build a new Phoenix Transport, allowing Phoenix PubSub to work with a bidirectional HTTP/2 channel. We will investigate how existing transports work, and what changes are required to implement a custom transport.
Definitely a more low-level talk. I also wanted to point out that the actual video is only 43 minutes, there’s about 15 minutes of a black screen at the end of the video.
I’m not sure what the best way to integrate server push with Phoenix templates would be. Adding server push directly to static_path is of course asking for trouble. Easiest is probably to add server push url’s to the conn (or a field on the conn), but that might not be the nicest API since they could easily get out of sync.
Since phoenix templates are really just io lists, perhaps we could have special elements in the list that will render into the HTML as the static path, but will also define a path that will be server-pushed.