SignalR Method Calls - Faster than Conventional AJAX Calls? -


if web application has number of regular ajax methods in it, i've introduced always-on signalr connection, worth refactoring make regular ajax methods hub methods instead? faster since it's using already-there connection?

imho misuse of signalr.

would faster? depends on several factors. first of which transport ends being used. if it's web sockets, then, yes, because message sent on connection that's guaranteed established, if it's sse or longpolling you're still doing plain old http post every time send messages. second factor if server allowing keep-alive connections, browsers keep open tcp connections server period of time between requests anyway there no overhead in terms of establishing connection anyway.

also, let's not forget our powerful friend verb , goodness brings in terms of 1 of important features of web: caching. if have lot of cacheable data, wouldn't want sending real-time messages on web sockets fetch , retrieve because you're throw out entire infrastructure of web if do. browsers can't more, you'd have build intelligence local storage , custom messages be, lack of better word, insane. :) give power of proxies caching public data entirely extremely underrated in terms of how can performance.

my guidance leave can simple request/response way today leveraging ajax , use technology signalr it's intended be: real-time communications.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -