For example, when you have a in site message, you want to notify users who are visiting a page of the site. Is signalR proper here? Using it means we have to establish a signalR connection everytime when user visit any page, is the performance good enough?
will it slow the loading of the page significantly? If we don't use signalR, what is best option?
Too vague. We don't have any details about the kind of "general notification" you are talking about. Basically do you need the server to send something "immediately" to your client? If yes, use SignalR, if not use low frequency polling or just wait for the
next page refresh.
Thanks, we do need notify user immdiately, or that is the best if we do it. I just wonder if it is right to have a signalr connection when user visit any page just for sending them some notification.
Forget about SignalR for now. I expected rather something like "I'm doing a chat application" or "I want to tell them about the next maintenance downtime" or "I want to tell about stock price changes" etc...
If you tell us you need SignalR but wonder if you should, there is no way to give any usefull advice. If we know WHY you feel you need SignalR, then perhaps one will be able to tell you if it feels ok or if it could be done another way (for now it looks
a bit strange that you need that on ALL pages on your site if I understood)...
Ok, we have a online training web site, both student and instructor can work on them, student can request to work with instructor in an app, so they go to the instructor listing page to click a button to send request. Instructors will have the site open,
and they could see student request on a mentoring page, that page is dynamically refreshed by signalR.
Now what I am thinking is a way that instructor can have a on page notification while they are on any page, not just the mentoring page, for example, the instructor could work on another page for some materials, we need a way to show a popup to tell them
they should to go the mentoring page and there is someone waiting for them.
SignalR does not refresh the page. It opens a persistent connection between the client and server and updates the client with the real time data.
wyx2000
Now what I am thinking is a way that instructor can have a on page notification while they are on any page, not just the mentoring page, for example, the instructor could work on another page for some materials, we need a way to show a popup to tell them they
should to go the mentoring page and there is someone waiting for them.
Actually if you are talking about displaying a notification outside of the browser, then you can't do that unless you install some desktop application on the client machine. What I suggest you to do instead is animating the title of the page like what facebook
do.
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js" charset="utf-8">
</script>
<script>
var flag = true;
$(function () {
test();
});
function test() {
if (flag) {
$(document).prop('title', 'You have');
flag = false;
}
else {
$(document).prop('title', '(1) notification');
flag = true;
}
setTimeout(test, 2000);
}
</script>
Member
14 Points
793 Posts
Is SignalR right for general web page notification?
Aug 16, 2014 02:19 PM|wyx2000|LINK
For example, when you have a in site message, you want to notify users who are visiting a page of the site. Is signalR proper here? Using it means we have to establish a signalR connection everytime when user visit any page, is the performance good enough? will it slow the loading of the page significantly? If we don't use signalR, what is best option?
thanks!
All-Star
43240 Points
14960 Posts
Re: Is SignalR right for general web page notification?
Aug 16, 2014 03:00 PM|PatriceSc|LINK
Hi,
Too vague. We don't have any details about the kind of "general notification" you are talking about. Basically do you need the server to send something "immediately" to your client? If yes, use SignalR, if not use low frequency polling or just wait for the next page refresh.
Member
14 Points
793 Posts
Re: Is SignalR right for general web page notification?
Aug 16, 2014 03:05 PM|wyx2000|LINK
Thanks, we do need notify user immdiately, or that is the best if we do it. I just wonder if it is right to have a signalr connection when user visit any page just for sending them some notification.
All-Star
43240 Points
14960 Posts
Re: Is SignalR right for general web page notification?
Aug 16, 2014 03:33 PM|PatriceSc|LINK
Forget about SignalR for now. I expected rather something like "I'm doing a chat application" or "I want to tell them about the next maintenance downtime" or "I want to tell about stock price changes" etc...
If you tell us you need SignalR but wonder if you should, there is no way to give any usefull advice. If we know WHY you feel you need SignalR, then perhaps one will be able to tell you if it feels ok or if it could be done another way (for now it looks a bit strange that you need that on ALL pages on your site if I understood)...
Member
14 Points
793 Posts
Re: Is SignalR right for general web page notification?
Aug 16, 2014 06:07 PM|wyx2000|LINK
Ok, we have a online training web site, both student and instructor can work on them, student can request to work with instructor in an app, so they go to the instructor listing page to click a button to send request. Instructors will have the site open, and they could see student request on a mentoring page, that page is dynamically refreshed by signalR.
Now what I am thinking is a way that instructor can have a on page notification while they are on any page, not just the mentoring page, for example, the instructor could work on another page for some materials, we need a way to show a popup to tell them they should to go the mentoring page and there is someone waiting for them.
All-Star
52711 Points
9668 Posts
MVP
Re: Is SignalR right for general web page notification?
Aug 25, 2014 03:59 AM|Ruchira|LINK
SignalR does not refresh the page. It opens a persistent connection between the client and server and updates the client with the real time data.
Actually if you are talking about displaying a notification outside of the browser, then you can't do that unless you install some desktop application on the client machine. What I suggest you to do instead is animating the title of the page like what facebook do.
Perhaps you can even play a little sound.
Please 'Mark as Answer' if this post helps you
Developer Tools Download | Windows 10 Videos | My Tech Blog