improved WebSocket and long poll performance