Ajay Suwalka
Ajay Suwalka

Reputation: 531

signalR hub is taking too much time to load

Retrieval of /signalr/hubs gets very slow after 5-10 minutes, I've to restart app pool again and again. Is there any way to cache this?

What I've done-

  1. Checked all the memory and cpu allocations for App pool but couldn't find anything.

  2. Searched on google but didn't find anything relevant

Upvotes: 2

Views: 1614

Answers (1)

Divya
Divya

Reputation: 1213

You can try putting this jquery functions in you View Page.

var tryingToReconnect = false;

$.connection.hub.reconnecting(function() {
    tryingToReconnect = true;
});

$.connection.hub.reconnected(function() {
    tryingToReconnect = false;
});

$.connection.hub.disconnected(function() {
    if(tryingToReconnect) {
        notifyUserOfDisconnect(); // Your function to notify user.
    }
});

Also check if you network connection is slow.

$.connection.hub.connectionSlow(function() {
    notifyUserOfConnectionProblem(); // Your function to notify user.
});

You'll get exact idea about the problem weather issue is because of signalR or not. Hope this helps.

Upvotes: 3

Related Questions