server-push-polyfill-demo icon indicating copy to clipboard operation
server-push-polyfill-demo copied to clipboard

Use rel=preload instead of X-...

Open igrigorik opened this issue 10 years ago • 1 comments

Nice demo! One suggestion... You should look for Link: ...; rel=preload headers to determine which resources should be preloaded: http://w3c.github.io/preload/#developer-server-and-proxy-initiated-fetching

h2o, Apache, and few other servers already support this and use it to initiate server push.

igrigorik avatar Dec 01 '15 20:12 igrigorik

Thanks. I didn't know there was a spec for this. Good news too that a few servers are already implementing server push.

I deliberately avoided looking into what w3c headers could/should be used, as I was worried about overloading them and risking unnecessary duplicate requests. Thinking more about it, the polyfilling service worker would be incompatible with real server push, but then again the range of browsers that support service worker but not http2 is [practically] nil, so it'd be ok to remove the polyfill as soon as you move to serving from a push enabled server.

wheresrhys avatar Dec 01 '15 23:12 wheresrhys