DevOps Fundamentals March 7, 2026 · 3 min read

What Actually Happens When Someone Visits Your Website

What Actually Happens When Someone Visits Your Website

The Split-Second Journey From Click to Page Load

You've built an amazing app with Claude's help, deployed it with a slick CI/CD pipeline, and shared the URL with the world. But have you ever wondered what actually happens in those crucial milliseconds between someone clicking your link and seeing your beautiful interface?

Let's trace this journey step by step. Understanding this process isn't just developer trivia - it's the foundation for making smart decisions about hosting, performance, and why your deployment choices actually matter.

Step 1: DNS Lookup - Finding Your Server's Address

When someone types yourapp.com into their browser, the first thing that happens is a DNS (Domain Name System) lookup. Think of DNS as the internet's phone book.

The browser asks: "Hey, where does yourapp.com actually live?"

This query bounces through several DNS servers:

  1. The user's local DNS cache
  2. Their ISP's DNS resolver
  3. Root nameservers
  4. Your domain's authoritative nameservers

Eventually, it gets back an IP address like 192.168.1.100. This whole process typically takes 20-100ms, but can be much slower with poor DNS providers.

Pro tip: This is why choosing a good DNS provider matters. Cloudflare's DNS is blazing fast, while some cheap registrars can add hundreds of milliseconds to every request.

Step 2: TCP Handshake - Establishing Connection

Now the browser knows where your server lives, but it needs to establish a connection. This happens through a TCP three-way handshake:

  1. Browser: "Hey server, can we talk?" (SYN)
  2. Server: "Sure, let's chat!" (SYN-ACK)
  3. Browser: "Great, let's do this!" (ACK)

This back-and-forth takes time - usually one round-trip to your server. If your server is in New York and your user is in Tokyo, that's ~200ms right there.

This is why edge locations matter. Services like Vercel's Edge Network or AWS CloudFront put servers closer to your users, cutting this latency dramatically.

Step 3: TLS Handshake - Securing the Connection

If your site uses HTTPS (and it should!), there's another handshake for TLS encryption:

  1. Browser requests your SSL certificate
  2. Server sends certificate and public key
  3. Browser verifies the certificate
  4. They exchange keys and establish encrypted communication

This adds another 1-2 round trips. Modern TLS 1.3 is faster than older versions, and techniques like TLS session resumption can speed up repeat visits.

# You can test TLS handshake time with:
curl -w "@curl-format.txt" -o /dev/null https://yourapp.com

Step 4: HTTP Request - Asking for Content

Finally! The browser can make the actual HTTP request:

GET / HTTP/2
Host: yourapp.com
User-Agent: Mozilla/5.0...
Accept: text/html,application/xhtml+xml...
Accept-Encoding: gzip, deflate, br

The browser tells your server exactly what it wants and what formats it can handle. Notice Accept-Encoding - this is where compression like gzip comes into play.

Step 5: Server Processing - Your Code in Action

Now your server gets to work. What happens here depends entirely on your architecture:

Static Site (Jamstack):

  • Server immediately serves a pre-built HTML file
  • Lightning fast, usually <10ms

Server-Side Rendered (SSR):

  • Your Node.js/Python/Go code runs
  • Database queries execute
  • HTML is generated on-the-fly
  • Could be anywhere from 50ms to several seconds

Serverless Function:

  • Container spins up (cold start penalty)
  • Your code executes
  • Response is generated
  • Cold starts can add 100-1000ms+
// Example serverless function processing time
export default async function handler(req, res) {
  const startTime = Date.now();
  
  // Your app logic here
  const data = await fetchFromDatabase();
  const html = generateHTML(data);
  
  console.log(`Processing took ${Date.now() - startTime}ms`);
  res.status(200).send(html);
}

Step 6: HTTP Response - Sending Content Back

Your server responds with:

HTTP/2 200 OK
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Cache-Control: public, max-age=3600
Content-Length: 1234

<!DOCTYPE html>
<html>...

Those headers are crucial:

  • Content-Encoding: gzip saves bandwidth
  • Cache-Control tells browsers how long to cache
  • Content-Length helps browsers show progress

Step 7: Browser Rendering - Building the Page

The browser receives your HTML and starts the rendering process:

  1. Parse HTML - Build the DOM tree
  2. Parse CSS - Build the CSSOM tree
  3. Execute JavaScript - Modify DOM/CSSOM
  4. Layout - Calculate where everything goes
  5. Paint - Actually draw pixels
  6. Composite - Layer everything together

During this process, the browser might make dozens more requests for:

  • CSS files
  • JavaScript bundles
  • Images
  • Fonts
  • API data

Each one goes through a similar process (though DNS and TCP connections can be reused).

Step 8: Resource Loading - The Long Tail

Modern web apps often load resources progressively:

<!-- Critical CSS loads first -->
<link rel="stylesheet" href="critical.css">

<!-- Non-critical resources load later -->
<link rel="preload" href="hero-image.jpg" as="image">
<script defer src="app.bundle.js"></script>

This is where techniques like code splitting, lazy loading, and CDNs really shine.

Why This Matters for Your Deployment Strategy

Understanding this flow helps you make better decisions:

Choose the Right Hosting:

  • Static sites? Use a CDN like Vercel or Netlify
  • Dynamic apps? Consider edge compute or strategically located servers
  • Heavy processing? Maybe serverless isn't ideal (cold starts)

Optimize the Critical Path:

  • Use fast DNS providers
  • Enable HTTP/2 and compression
  • Minimize server processing time
  • Optimize your bundle size

Monitor the Right Metrics:

  • TTFB (Time to First Byte) - covers DNS through server response
  • FCP (First Contentful Paint) - when users see something
  • LCP (Largest Contentful Paint) - when the main content loads

The Reality Check

Here's the thing: all of this happens in under a second for a well-optimized site. But each step can be a bottleneck:

  • Slow DNS: +200ms
  • Distant server: +300ms
  • Cold serverless start: +500ms
  • Unoptimized database query: +1000ms
  • Large JavaScript bundle: +2000ms

Sudden your "fast" site takes 4+ seconds to load, and users bounce.

This is exactly why services like DeployMyVibe exist. We handle the boring but crucial stuff - fast DNS, edge locations, optimized server configs, monitoring - so you can focus on building amazing features with your AI coding assistant of choice.

Because at the end of the day, users don't care how clever your prompt engineering was. They just want your app to load fast and work reliably.

Alex Hackney

Alex Hackney

DeployMyVibe

Ready to deploy?

Stop reading about it. Start shipping.

View Pricing