|
INTERVIEW QUESTIONS
OPEN SOURCE APPLICATIONS
WEBSITE BUILDER
DETAILS
Question: What is Long polling, how does it work, and why would you use it?
Answer: There are two important drawbacks that need to be considered when using long polling:
Long polling requests are not different from any other HTTP request and web servers handle them the same way. This means that every long poll connection will reserve server resources, potentially maxing out the number of connections the server can handle. This can lead to HTTP connection timeouts. Each web browser will limit the maximum number of connections web application can make. This means that your application load time and performance may be degraded. In HTML5, a useful alternative to long polling is using a WebSocket. A WebSocket is a protocol providing full-duplex communications channels over a single TCP connection. The WebSocket protocol makes possible more interaction between a browser and a web site, facilitating live content and eliminates the need for the long polling paradigm.
Another potential answer could be Server-sent DOM Events. Which is method of continuously sending data from a server to the browser, rather than repeatedly requesting it. However, this HTML5 feature is not supported by Microsoft Internet Explorer, thus making it less attractive solution.
|
|
|
Category |
Website Builder Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7293 users |
Added on |
8/2/2016 |
Views |
71540 |
Rate it! |
|
|
Question:
What is Long polling, how does it work, and why would you use it?
Answer:
There are two important drawbacks that need to be considered when using long polling:
Long polling requests are not different from any other HTTP request and web servers handle them the same way. This means that every long poll connection will reserve server resources, potentially maxing out the number of connections the server can handle. This can lead to HTTP connection timeouts. Each web browser will limit the maximum number of connections web application can make. This means that your application load time and performance may be degraded. In HTML5, a useful alternative to long polling is using a WebSocket. A WebSocket is a protocol providing full-duplex communications channels over a single TCP connection. The WebSocket protocol makes possible more interaction between a browser and a web site, facilitating live content and eliminates the need for the long polling paradigm.
Another potential answer could be Server-sent DOM Events. Which is method of continuously sending data from a server to the browser, rather than repeatedly requesting it. However, this HTML5 feature is not supported by Microsoft Internet Explorer, thus making it less attractive solution. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain the purpose of each of the HTTP request types when used with a RESTful Web Service?
|
View Answer
|
|
What is Cross-origin resource sharing (CORS)? How does it work ?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Website Builder Interview Questions & Answers - Exam Mode /
Learning Mode
|