3 ms·
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 coo
by vertex-four 9y ago
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.
- donatj 9y agoUgh. That would work, but it’s such a hack. There should be a mechanism specifically for this. Is there’s no other good way?
- pas 9y agoThe 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.
- sebastiaand 9y agoThere is an experimental RFC currently being discussed: https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache-digest/ 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 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.
- ko27 9y agoDo you have a source for that Cuckoo filter proposal?