What Happens in the 50ms Between Click and Redirect

· 4 min · urlunicorn.com

You Click. Then What?

You click a short link like urlunicorn.com/spring-sale and end up on a product page. It feels instant. But between your click and the final page loading, a surprising amount happens -- and it all needs to finish in under 50 milliseconds or the experience feels sluggish.

Here is everything that happens inside that window, step by step, using URL Unicorn as the example.

Step 1: DNS Resolution (~5-15ms)

Your browser does not know where urlunicorn.com lives. It asks a DNS resolver, which returns the IP address of the nearest edge server. If you have visited any URL Unicorn link recently, your operating system has this cached and skips the lookup entirely. If not, the DNS query adds 5-15 milliseconds depending on your location and ISP.

This is the same step that happens for any website. The difference is that for a URL shortener, DNS speed matters more because the redirect itself is the entire user experience.

Step 2: Edge Function Lookup (~10-20ms)

The request hits an edge server -- a machine geographically close to you, not a central data center. An edge function receives the request and extracts the short code (spring-sale) from the URL path.

The function queries a database to find what destination URL is mapped to that code. Because the database replicates data globally, the read happens against a copy that is also geographically close. The lookup typically completes in under 10 milliseconds.

This is where dynamic link features live. The system checks whether the link has expired, whether it has been deactivated, and whether any conditional redirect rules apply (like mobile users going to an app store link instead of a web page).

Step 3: Analytics Capture (~0ms Added)

Before responding, the edge function fires off an analytics event: the timestamp, the visitor's approximate location (derived from IP), device type, browser, operating system, and the HTTP referrer (which page or app they came from). This event is written asynchronously -- it does not block the redirect response. The visitor never waits for analytics to finish.

These events accumulate into the dashboards that link owners see: clicks over time, geographic heatmaps, device breakdowns, top referrers. The data appears within seconds of the click.

Step 4: The 301 Response (~1ms)

The edge function returns an HTTP 301 (Moved Permanently) response with the destination URL in the Location header. The browser receives this and immediately starts loading the destination page. From the user's perspective, they clicked a link and arrived somewhere. The redirect was invisible.

The choice between 301 and 302 matters. A 301 tells the browser to cache the redirect, meaning future clicks skip the lookup entirely. A 302 forces the browser to check every time. URL Unicorn uses 301 for permanent links and 302 for links that might change destinations.

Why 50ms Matters

At 50ms, a redirect feels instant. At 200ms, users notice a flash. At 500ms, they wonder if the link is broken. URL shorteners live and die by redirect speed because there is no content to display while the user waits -- just a blank screen until the destination loads. Every millisecond of overhead is a millisecond of nothing.