简体   繁体   中英

Web socket performance

Can browser cache effect web-socket performance when there is a heavy load socket connection? What is the best way to close a web socket connection and reconnect if required?

I don't know how you think the browser cache might affect WebSocket performance. Restarting a WebSocket should be easy; you can just listen for the error or close events and then open the socket back up again. I run a WebSocket connection that takes about 2.5k short (ie 150b) JSON messages per second without breaking a sweat. Updating the DOM with info from the messages is much slower (to the point that we've had to throttle DOM updates).

Do you think that Browser caches disconnected web socket connections and this cache affects the web socket connection performance? Just wanted to know the cache you are referring to? If you are worried about closed or disconnected web socket connections, browser will not cache any web socket connections(closed or disconnected). I guess, cache you are referring is memory or web socket objects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM