DrupalCon Nashville 2018: Building "cooperative" APIs with HTTP/2
Channel: Drupal Association
Date: 2018-04-11

Much has been made of HTTP/2 and how it can improve frontend performance. It has challenged best-practices like JS minification and CSS aggregation. However, very little has been done to explore its impact on REST APIs. In this session, we're going to dive into HTTP/2 from a backend perspective and we'll see how its improved semantics and its expanded featureset enables a new way of thinking about RESTful APIs.

We'll see how client and server can work cooperatively to improve performance. We'll see how server push can solve tedious problems like paginated responses and eliminate requests entirely. Finally, we'll see how improvements borne out of HTTP/2 can still improve experiences for clients that don't yet support HTTP/2 or don't have the capability to take advantage of some of its features.

Attendees need not have any PHP or Drupal experience. An understanding of REST ideas like using the HTTP methods GET, POST, PATCH, or DELETE to read, create, update or remove resources will make it easier to follow along.



Truly sorry for cutting the session short; that's completely on me.

Here are all the links for all the relevant code. A little background that I couldn't get to:

Hades is an HTTP/2 server written in Go which parses the X-Push-Please header and server pushes the requested resources. Juissy is a new JSON API client that requires no configuration and can cooperate with Hades or fall back to HTTP/1.1 with no change in code or configuration (it's all handled in the library). It automatically handles pagination for you too.

There's a lot more to explored with all these things. I regularly post about HTTP/2 on Twitter and will be writing a blog post about these ideas soon. Stay tuned!

Demo: https://demo.sullice.com

Demo Code: https://github.com/gabesullice/cooperative-api-demo

Hades: https://github.com/gabesullice/hades (Hades is an experimental HATEOAS-based HTTP/2 reverse proxy for JSON API backends)

Juissy: https://github.com/gabesullice/juissy (Juissy is a minimal experimental JSON API client for Drupal)