I watched a page load using F12 and blazor.server.js is loaded multiple times (see below). I understand the browser loading multiple times because of the ?id=...
being different on each. But why does the Blazor code need to keep reloading the same Javascript file?
I found the type of the request is fetch
, it means you are using LongPolling
, not Websocket
.
So it's expected behavior for LongPolling
. Here is the official doc about Long Polling and SignalR
.
When using SignalR technology, it is recommended to use the Websocket protocol.