Ben-xD
Ben-xD
Explore posts from servers
TtRPC
Created by Ben-xD on 12/20/2023 in #❓-help
Why do people use SplitLink? (http + websocket)
Ahh, I guess you do lose caching
5 replies
TtRPC
Created by Ben-xD on 12/20/2023 in #❓-help
Why do people use SplitLink? (http + websocket)
Ahh, just found this interesting post: https://stackoverflow.com/a/29933428/7365866
5 replies
TtRPC
Created by Ben-xD on 12/20/2023 in #❓-help
Why do people use SplitLink? (http + websocket)
It's an interesting point on using resources - though that should definitely be measured (since you're saying use both HTTP + WS, not just WS, or just HTTP). Websocket messages are more efficient than http requests, which send the headers on every request, including possibly a large JWT. It can also require establishing a new connection and handshake with the server. I've seen benchmarks from websocket backends (centrifugo) that mention 500mb of memory for 10k websocket clients - we already need to pay this cost because we're using websockets. For an app that already uses websockets for subscriptions, I don't see the value of also using HTTP, I really value the consistency of using websockets for everything - it simplifies authentication as well. Note: my tRPC APIs still do support HTTP because I use trpc-panel, which uses HTTP (it also doesn't support subscriptions). I just currently use wsLink on the client/browser, not splitLink. I'm still genuinely curious if I'm missing something. Is that performance impact obvious that we don't need to measure? or have you already measured it? I really wonder why go for the split link
5 replies