Frontend System Design Course
Frontend System Design
/
Intermediate

Long Polling

Definition

In Long Polling, the client makes a request, but the server intentionally holds the connection open until it actually has new data to send. Once sent, the client immediately opens a new long-polling connection.

Explain Like I'm New

Asking 'Are we there yet?' but the parents don't answer until 3 hours later when they finally arrive.

Interview Questions

basic

  • What is the core concept of Long Polling?
  • What are the pros and cons of Long Polling?

intermediate

  • How does Long Polling impact SEO and initial page load times?
  • When would you NOT choose to use Long Polling?

advanced

  • How does Long Polling fit into a heavily scaled microservices architecture?
  • What are the security implications of Long Polling?

trick

  • Can you combine Long Polling with other rendering strategies on the same page?

Flash Cards

Question

Define Long Polling.

Click to reveal answer
Answer

Long Polling is a critical architectural pattern in frontend design.

Question

What is the main tradeoff of Long Polling?

Click to reveal answer
Answer

Usually a tradeoff between Server CPU usage, TTFB (Time to First Byte), and Client CPU usage.