http/2 server push

11

Click here to load reader

Upload: apache-traffic-server

Post on 13-Apr-2017

159 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: HTTP/2 Server Push

Apache Traffic Server

HTTP/2 Server Push

Masakazu Kitajo [email protected]

Page 2: HTTP/2 Server Push

What is Server Push?• One of the features of HTTP/2

• Allows sending resources to a client before the client requests them

• Avoids additional round trips

• May reduce time to first paint

• if we could use it wisely

Page 3: HTTP/2 Server Push

How does it work?

Server Push

GET /index.html

GET /index.html

Client Intermediate Origin server

index.html

index.html

Page 4: HTTP/2 Server Push

How can we use it on TS?• TSHttpTxnServerPush

• Introduced since 7.0

• Experimental

• An example plugin is available

#include <ts/experimental.h>

void TSHttpTxnServerPush(TSHttpTxn txnp, const char *url, int url_len)

Page 5: HTTP/2 Server Push

What will happen inside?Client Http2Stream PluginHttpSM

TSHttpTxnServerPush()

hook->invoke()

Http2ClientSession

send_push_promise_frame()PUSH_PROMISE

HEADERS

send_request()handleEvent()

send_request()handleEvent()

new_transaction()

new_transaction()

hook->invoke()

Page 6: HTTP/2 Server Push

What will be a problem?

Server Push

GET /index.htmlGET /index.html

?We don’t know which resources we should push.

The client may already have the resource. The push may delay the response from an origin.

Page 7: HTTP/2 Server Push

What can we do?• Use Manifest files

• Use Link header

• Use Link element in a HTML document

• Use Cache Digests (a.k.a CASPER)

• Also needs client side implementation

• Use AI (machine learning)

Simple

Complex

Page 8: HTTP/2 Server Push

Future plan

• Add experimental plugins

• Add Server Push metrics (maybe 7.1.0)

• Brush up the API

• Show some results in the next summit

Page 9: HTTP/2 Server Push

Summary• Server Push MAY increase performance

• Server Push CAN decrease performance

• Server Push API is available since TS 7.0

• Server Push may be too complicated for human beings

WE NEED YOUR FEEDBACK!

Page 10: HTTP/2 Server Push

Thank you

Page 11: HTTP/2 Server Push

References• HTTP/2 Server Push

• https://tools.ietf.org/html/rfc7540#section-8.2

• Link header & Link element

• https://www.w3.org/TR/preload/

• Cache Digests

• https://tools.ietf.org/html/draft-ietf-httpbis-cache-digest-00

• Akamai - Are you ready for HTTP/2 Server Push?!

• https://blogs.akamai.com/2016/04/are-you-ready-for-http2-server-push.html

• Cloudflare - Announcing Support for HTTP/2 Server Push

• https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/

• Fastly

• https://www.fastly.com/blog/announcing-limited-availability-http2