Can I use a link tag to preconnect to a WebSocket destination?
Asked Answered
C

0

11

I have a website that uses WebSockets to connect to the server and transfer data.

At css-tricks.com, they showed the following example for using HTML link tag preconnect:
<link rel="preconnect" href="https://css-tricks.com">

Can I use this to connect to WebSockets, or at least speed it up? Something like this
<link rel="preconnect" href="wss://css-tricks.com">

Is there a way I can tell if it is even working when I try the WS connection? Or even with the HTTP connection?

Cumquat answered 1/4, 2020 at 20:8 Comment(1)
Do you try to put the wss connection in a jsfile and do the preconnect to the jsfile ?Swedish

© 2022 - 2024 — McMap. All rights reserved.