What Happens When You Click a Short URL? Behind the Redirect
You click a short link like doin.cc/example and—almost instantly—you’re on a completely different website. It feels like magic, but it’s actually elegant engineering. Let’s peek behind the curtain.
The Journey of a Click (In Milliseconds)
When you click a short link, here’s what happens:
Step 1: DNS Resolution (10-100ms)
Your browser asks: “Where is doin.cc?”
The Domain Name System (DNS) translates the human-readable domain into an IP address. This happens before anything else.
Step 2: Connection Established (20-100ms)
Your browser connects to the URL shortener’s server using HTTPS. This includes TCP handshake and TLS/SSL negotiation for security.
Step 3: Request Sent (1-5ms)
Your browser sends a simple request asking for the short code.
Step 4: Database Lookup (1-50ms)
The server receives your request and looks up the code in its database:
- Is this a valid short code?
- What’s the destination URL?
- Is the link expired or disabled?
Modern URL shorteners use extremely fast databases (often in-memory caches) to minimize this step.
Step 5: Redirect Response (<1ms)
The server responds with a redirect instruction telling your browser where to go next.
Step 6: Following the Redirect
Your browser automatically follows the redirect and connects to the destination website.
Total time: 100-500ms typically, often faster on modern infrastructure.
Redirect Types: 301 vs 302
Not all redirects are the same:
301 Redirects (Permanent)
- Browser caches the redirect
- Search engines transfer SEO value to destination
- Best for: Permanent links, SEO-sensitive content
302 Redirects (Temporary)
- Browser doesn’t cache (much)
- Each click goes through the shortener
- Better for tracking—every click is counted
- Best for: Marketing campaigns, analytics needs
Why Short Links Are Fast
Modern URL shorteners are engineered for speed:
Edge Computing
Many shorteners run on edge networks (like Cloudflare Workers). This means servers close to users worldwide, lower latency everywhere.
In-Memory Databases
Instead of slow disk lookups, short code mappings are cached in RAM with sub-millisecond retrieval times.
Minimal Processing
A good redirect service does very little: look up the code, log the click asynchronously, return the redirect.
What Gets Logged?
When you click a short link, the service typically records:
- Timestamp: When the click happened
- Short code: Which link was accessed
- Referrer: Where the click came from (if available)
- User agent: Browser and OS information
Privacy-focused services minimize data collection and don’t track individuals across clicks.
Common Questions
Do short links slow down my website’s SEO?
For properly implemented 301 redirects, search engines pass most SEO value to the destination.
Can short links be hacked?
The redirect itself is secure (via HTTPS), but you should only click short links from trusted sources.
What if the service goes down?
Quality services have uptime guarantees (99.9%+). For critical infrastructure, consider the dependency.
Why not just use the original URL?
Short links offer memorability, trackability, print friendliness, character savings, and link management.
The Technical Evolution
URL shortening has evolved dramatically:
Early days (2000s): Simple database lookups, single server deployments
Modern era (2020s): Edge-deployed globally, sub-50ms response times, rich analytics, API integrations, privacy considerations
Under the Hood
The core logic is simple: look up code, return redirect. But the devil is in the deployment details—edge networks, caching strategies, monitoring, and failover systems.
Understanding how short links work helps you choose reliable services and make informed decisions.
Technology should be understood, not just used. Now you know.