25

As per title, would SignalR be a suitable substitute for general Ajax (e.g. jQuery Ajax) updates used in web pages.

Thanks

0

1 Answer 1

28

If all you need to do is browser-initiated calls to the server triggered by user actions then you should just use jQuery Ajax.

Only use SignalR where the server needs to update the client asynchronously to any user action. Use it in situations where you would traditionally have used a timer and an Ajax call to poll the server repeatedly to see if anything has changed.

In a situation where you have both kinds of call happening you can use SignalR for both the user actions and the server delivered notifications but it may still be easier/cleaner to keep them separate.

1
  • Why shouldn't you use SignalR for pages that only need browser initiated requests? Seems perfectly acceptable to do so. Has this changed over time?
    – YungDeiza
    Nov 30, 2022 at 14:44

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.