-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Cache-Digest (Server Push optimization) #12
Comments
This sounds like an awesome feature! +1 would love to see. However, I would think this would be implemented in some sort of caching layer directly above http2 transport. The http2-cache.js is meant to be that layer (eventually, when fully implemented): https://github.com/kaazing/http2-cache.js. Suggest closing this and moving the issue there :-) |
Cache-Digest is currently a draft for the official HTTP/2 spec. It controls what assets are pushed before they are pushed. It is not a cache layer and not a client side cache. The client will calculate a hash that is processed by the HTTP/2 server. An example of the client side hash calculation can be found in the following library (a Service Worker that calculates Cache-Digest). https://gitlab.com/sebdeckers/cache-digest-immutable Cache-Digest could become part of the official HTTP/2 spec: http://httpwg.org/http-extensions/cache-digest.html |
Thanks, understand now. This story has two parts, support for the frame type AND an API exposed to use (send/receive) that frame type. I would think the use of that frame (i.e. calculating the digest for the client and then using the digest on knowing what to push for the server) would be implemented in a caching layer above http2.js. Thus I would think the API only need to return a way to set/get that value. Thoughts? |
I believe that only a Service Worker would be able to provide the functionality as it is able to include a custom Cache-Digest header to navigation related requests. A Service Worker is like a client side proxy that captures requests and is able to modify them. https://developers.google.com/web/fundamentals/primers/service-workers/ The Service Worker could detect what resources have been pushed so that a Cache Digest could be calculated based on previously pushed resources. This would make management more simple: it will simply calculate a hash for resources that have been pushed by the HTTP/2 server and that therefor are likely to be relevant, while ignoring the potential thousands of other files. An expire time could further restrict the complexity of the hash calculation so that it could become as efficient as possible. The example in The Above The Fold Optimization plugin provides HTTP/2 Server Push optimization based on Cache-Digest. This is the reason that we are interested to help make it available. It will be a very big step forward for front end performance optimization. |
Hi!
It would be nice if the Server Push implementation would support Cache-Digest. It will reduce both latency and bandwidth.
https://calendar.perfplanet.com/2016/cache-digests-http2-server-push/
http://httpwg.org/http-extensions/cache-digest.html
https://jakearchibald.com/2017/h2-push-tougher-than-i-thought/
The text was updated successfully, but these errors were encountered: