문제

I'm developing a website that uses a notification system (like the Facebook's one). For this purpose I think I'll write a JQuery polling function that look for new notification in the server side, using ajax.

My question is, is this a good idea?

도움이 되었습니까?

해결책

It will be ok for client side, it's more likely to be a server issue. http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-016.pdf

In conclusion, if you want high data coherence and network performance you should use push rather than pulling. But push will consume more cpu thus has scalability issue.

The efficiency of pulling depends on the pull interval vs publish interval. If they equal, everything will be perfect. But realistically they will never meet.

Some additional personal opinion, if your server script is blocking in nature (like ruby on rails with single thread server). You better rethink the solution.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top