Why does the one _blazor.js call take 1.5 minutes?

David Thielen 2,506 Reputation points
2024-06-26T02:37:46.12+00:00

Hi all;

I am load testing my blazor app. As the load test was running I loaded a page myself with F12 displaying in my browser and see this (it consistently happens):

2OOS0jM6[1]

Why does this one call to blazor.server.js take 1.5 minutes? And is there anything I can do to speed it up?

As to could something in my Blazor app be causing this? Possibly. But I have no idea what and therefore have no idea if there's anything specific in my code that is causing this.
thanks - dave

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,472 questions
0 comments No comments
{count} votes

Accepted answer
  1. JasonPan - MSFT 4,791 Reputation points Microsoft Vendor
    2024-06-26T06:52:46.87+00:00

    Hi @David Thielen ,

    It's a normal behavior in your project, we don't need to speed it up.

    I found you are using LongPolling in your blazor project, that why we can see a lot of (fetch) http requests like [https://localhost:7043/_blazor?id=Iwns6](https://localhost:7043/_blazor?id=Iwns6IpNs2UkqNaIq6Xe_Q&_=1719383611048)_[pNs2UkqNaIq6Xe_Q&_=1719383611048](https://localhost:7043/_blazor?id=Iwns6IpNs2UkqNaIq6Xe_Q&_=1719383611048)_.

    User's image

    Blazor Server applications use SignalR to manage real-time communication between the client and the server, enabling efficient data exchange and state synchronization.

    In SignalR, there are three protocols: WebSocket(Default), LongPolling, and ServerSentEvents.

    If we are using websocket, we can find the behavior like below. You can verify it by creating a brand new project.

    User's image

    _blazor?id=Iwns6IpNs2UkqNaIq6Xe_Q&_= *** It means that the front-end and back-end keep communicating, and 1.5min should be the browser's default behavior or configuration for LongPolling.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Jason

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful