2 ms·
> This made me wonder, why aren't we just always pushing the entire resource state over websockets. Because this won't respect HTTP caching and you'll end up s
by krainboltgreene 6y ago
> This made me wonder, why aren't we just always pushing the entire resource state over websockets.
Because this won't respect HTTP caching and you'll end up sending way more data than you need. Best instead to just send up URI and `GET/DELETE` verbs to indicate intent. I wrote about this: https://github.com/krainboltgreene/pubway.js#pubway https://github.com/krainboltgreene/pubway.js#pubway
Actually every HTTP benefit is a reason why you wouldn't want to send resources over websocket. What if the websocket connection is slower than changes to the resource? Instead of simply telling the client what to fetch, you just gave them stale data.