惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
L
LangChain Blog
The GitHub Blog
The GitHub Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
V
V2EX

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Short polling ,Long polling And SSE
Guruharish B · 2026-06-22 · via DEV Community

Guruharish B

Polling:
Polling is the method in which client repeatedly checks server for new information

Short polling:
Short polling is the method in which client repeatedy checks server by sending request at regular interval of time to get new information

Example (Customer, Chef, and Servant)

  • Imagine a customer orders food in a restaurant, the chef is preparing food (server),client is waiting for the order he/she placed(client) and servant act as communication channel(api).

In Short Polling, the customer repeatedly asks the servant (whether the food is ready?)(whether the food is ready?) at regular interval of time(eg 5 seconds).
The servant goes to the chef every time, checks the status, and returns with an update, even if the food is not ready.

As the result, the customer keeps waiting and asking frequently.

Drawback:

  1. Too many request
  2. Delayed updates(If the food becomes ready right after a poll, the customer must wait until the next polling interval to receive the update)
  3. Network overhead

Long polling:

Long polling is the method in which the client sends a request to the server, and the server keeps the connection open until new data is available or a timeout occurs. The client also sets a timeout period for waiting for the response.

Example (Customer, Chef, and Servant)

  • Imagine a customer orders food in a restaurant, the chef is preparing food (server),client is waiting for the order he/she placed(client) and servant act as communication channel(api).

In Long Polling, the customer asks the servant **(Tell me when my food is ready)
**The servant goes to the chef and waits there.

  • If the chef finishes the food before the waiting time expires, the servant immediately returns and informs the customer.

If the chef does not finish the food within a certain time ,the servant says that the food is not read
The customer then asks again:
(Please let me know when it is ready)
The servant goes back to the chef and waits again.

Drawback

  1. Connection timeout issues
  2. Open connection for a long time.
  3. The servant waits continuously, making it inefficient for many customers.

Server Sent Events (SSE)
In Server-Sent Events (SSE), the client establishes a one way connection with the server and waits for updates. The server sends data to the client whenever new information becomes available, without requiring the client to repeatedly request updates.

Example
In ,live stock prices client make an SSE connection then server keeps the connection open.Whenever a stock price changes, the server notify the info to the client.
The client only receives data; it doesn't send messages through the SSE connection.(one way communication ie., server--> client)