Posts tagged #web
-
How a message queue decouples two services
A message queue holds work between two services. The sender drops a message in and moves on, and a consumer takes it when ready.
-
How rate limiting works
A token bucket refills at a steady rate and every request spends one token. When the bucket is empty, the server answers 429 and can say when to retry.
-
How CORS works
Browsers block a page from reading another origin's response. CORS headers are how a server says who may read it, with a preflight for riskier requests.
-
How a cookie keeps you logged in
HTTP forgets you between requests. A cookie holding a random session ID is how a server recognizes you again after you log in.
-
How a CDN serves files from a server near you
A CDN keeps copies of files on servers close to visitors. A fresh copy is answered at once, and a missing one is fetched from the origin server first.
-
How WebSockets differ from polling
A WebSocket keeps one connection open so either side can send messages. Polling makes the client ask every time, often for nothing.
-
What a REST request and response look like
A call to a web API is an HTTP request and a response with the same shape: start line, headers, an empty line and a body. The method and status code carry the meaning.
-
How a cache makes things faster
A cache keeps a copy of an earlier answer close by. In HTTP, a fresh copy is reused as is, and a stale one is checked with a small 304 reply.
-
What happens when you type a URL and press Enter
Pressing Enter starts a short chain: find the server's address, open a connection, ask for the page, then draw it on screen.