← All articles

What happens when you open a short link

Updated Nov 8, 2026 · 3 min read

Clicking a short link feels instant, but a lot happens between the click and the page you land on. Walking the path one hop at a time is the best way to see which parts you control, which parts you can only influence, and where the milliseconds go.

12TCP + TLS34miss5302 + long URLBrowserDNSLoad balancerApp serverCacheDatabase
One click, hop by hop. The numbers match the sections below.

1. DNS finds the server

The browser has a name, like sho.rt, and needs an IP address. It checks its own cache, then the operating system’s, then asks a recursive resolver (usually run by the ISP or a public DNS provider). If the resolver has no fresh answer, it asks the root servers which servers handle .rt, asks those which servers handle sho.rt, and asks those for the address. Every answer comes with a TTL saying how long it may be reused.

A cached answer costs nothing; a full lookup can take tens of milliseconds. Long TTLs keep most lookups cached, at the price of slower failover when an address changes.

2. Connect with TCP and TLS

Before any HTTP is sent, the browser opens a connection. TCP needs one round trip to set up, and TLS 1.3 needs one more to agree on keys, so a fresh HTTPS connection costs about two round trips before the first byte of the request. HTTP/3 runs over QUIC, which folds both into a single round trip. Browsers keep connections open and reuse them, so a second click to the same host skips this step entirely.

3. The load balancer picks a server

The address DNS returned usually belongs to a load balancer, not an application server. It terminates TLS, checks which app servers are healthy, and forwards the request to one of them. To the browser, the whole fleet looks like one machine.

4. The app server looks up the code

The app server reads the code from the path (/x7Kp2Qa) and looks for it in the cache first. Most popular links are found there in under a millisecond. On a miss it reads the database, then stores the result in the cache so the next click is fast.

5. Respond with a 302 and the long URL

The server answers 302 Found with the long URL in the Location header, and drops a click event on a queue to be counted later. It does not wait for the counting.

6. Follow it and start again for the destination

The browser reads the Location header and repeats the whole journey for the destination. DNS for its host, a new connection, a request, and finally the page. The short link’s job is done, and everything after this point is someone else’s server.

Where the time goes

StepColdWarm (cached, reused)
DNS lookup20–100 ms~0 ms
TCP + TLS 1.3 handshake~2 round trips ≈ 30 ms~0 ms
Request and response travel~1 round trip ≈ 15 ms~15 ms
Load balancer + app + cache hit1–2 ms1–2 ms
Database read on a cache miss+1–5 ms—
A first click on a short link, for a visitor about 1,000 km from the servers (round trip ~15 ms)
DNS lookup20–100 ms
TCP + TLS handshake~30 ms
Request and response travel~15 ms
Load balancer, app and cache1–2 ms
A cold first click, step by step. The servers’ own work is the smallest bar.

What you can do about each step

  • For DNS, use a fast provider with servers near users, and reasonable TTLs.
  • For connections, support HTTP/2 and HTTP/3, and keep connections alive.
  • For distance, serve from several regions, or answer redirects from a CDN or edge function close to the visitor.
  • In the app, keep hot links in cache and keep anything slow, like click counting, off the request path.