on-internet
← Community

Whats the most efficient way to pull new messages?

Stack Overflow ·

I run a small chat site for students at my school (about 140 users). It's built with plain JavaScript on the frontend and PHP on the backend, on shared hosting. Right now each open tab polls the server about once per second: GET /chat/?poll=1&listV=eecc4cd414d8f9c9&requestsV=ef46db3751d8e999 GET /chat/?poll=1&listV=...&requestsV=...&nav=messages%3D1%26after%3D2633 listV and requestsV are hashes of the chat list and friend requests. The server compares them and only sends data back when something has changed. after is the ID of the newest message the client already has. This works, but: Every o

Comments

Sign in or sign up to comment and upvote.

No comments yet.