Re:Nginx HTTP/2 server push support
by vertex-four on Tuesday February 13, 2018 @05:42AM
(#16366148)
I think (not sure if this has been agreed as best practice) that you can use cookies to decide which content to push. This should work in most cases - set a cookie that lasts as long as your users' cache, and don't do server push if that cookie exists.
[ Parent
| on HN ]
Ugh. That would work, but it’s such a hack. There should be a mechanism specifically for this. Is there’s no other good way?
The problem is cache coherency, also known as consistency protocols. It's The Hard Problem of computing science, because you have to synchronize state. You have to use information to tell the other party what do you have, and that can be done with a HTTP header, like the Cookie.
Re:Nginx HTTP/2 server push support
by sebastiaand on Tuesday February 13, 2018 @12:46PM
(#16369068)
There is an experimental RFC currently being discussed:
https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache-di...
The technique is derived from the H2O Casper work (and by the same author).
I have a Javascript service worker implementation here: https://www.npmjs.com/package/cache-digest-immutable
Note: This is still based on a Golomb-coded set (GCS). Current proposal under discussion is to use a Cuckoo filter. Takes slightly more bandwidth but allows removal when browser caches evict items.