- Knowledge
- technology
- OOP
- Tips
- Programming
- Tips
- Tutorial
- SEO
- Ranking
- Knowledge
- Special Day
- Seo
- Bug
- Data science
- Seo
- artificial intelligence
- Machine Learning
- Robotics
- happyNewYear2021
- newYearEve
- 2021
- Automation
- Smart Home
- Career
- Best Practices
- Git
- Logging
- Web Fundamentals
- DNS
- HTTPS
- Performance
- AI Tools
- ChatGPT
- Claude
- Gemini
- Laravel
- Eloquent
- MySQL
- HTTPS
- TLS
- Web Security
- Certificates
- Developer Life
- Debugging
- Docker
- DevOps
- Transactions
- Queues
- LLMs
- AI
- AI Coding
- Developer Tools
- React Native
- Expo
- Kate PMS
- Mobile Apps
- Laravel
- Authentication
- Sanctum
- Cookies
- API Design
- Payments
- Idempotency
- DeepSeek
- Open Source AI
- LLMs
- AI News
- Git
- Version Control
- AI Coding
- Prompting
- PHP
- Checklist
- MCP
- AI Agents
- OpenAI
- Architecture
- Microservices
- Modular Monolith
- Estimation
- Developer Life
- Project Planning
- Humour
- OAuth
- OpenID Connect
- Authentication
- Embeddings
- Vector Search
- RAG
- pgvector
- OpenAI
- GPT-4.1
- Codex CLI
- Events
- Testing
- Clean Code
- Maintainability
- Code Review
- Webhooks
- API
- Security
- Claude Code
- Workflow
- AI
- LLM
- Prompt Injection
- Mobile
- React
- Networking
- TCP
- UDP
- HTTP/3
- CLAUDE.md
- AWS
- Cloud Security
- Backups
- PHPUnit
- Software Engineering
- Leadership
- Communication
- RAG
- Embeddings
- AI Engineering
- IT Infrastructure
- Networking
- Access Control
- CI/CD
- GitHub Actions
- Gemini CLI
- Claude Code
- JavaScript
- Async/Await
- Node.js
- Promises
- Security
- Cryptography
- Passwords
- MySQL
- Database
- Vibe Coding
- Software Quality
- DNS
- Code Reading
- Onboarding
- Productivity
- Background Jobs
- Developer Humour
- Estimates
- Dev Life
- JWT
- o3-mini
- DeepSeek R1
- Rate Limiting
- Kate PMS
- E-Signing
- Audit Trail
- REST
- GraphQL
- API Design
- Laravel 12
- Upgrade Guide
- Open Source
- Self-Hosting
- Task Scheduling
- Cron
- Secrets
- CORS
- PHP
- PHP-FPM
- OPcache
- GitHub Copilot
- Software Architecture
- Engineering
- TypeScript
- JavaScript
- Type Safety
- AI Security
- React Native
- Product Design
- AI Agents
- Kiro
- Queues
- Redis
- RabbitMQ
- AWS SQS
- Nginx
- Apache
- GPT-5
- gpt-oss
- Clean Code
- Architecture
- Naming
- Documentation
- Career
- ADR
- Teamwork
- Supply Chain
- Kate HRM
- HR Software
- Permissions
- System Design
- Pagination
- SSH
- Linux
- Big O
- Databases
- Laravel Boost
- MCP
- Developer Skills
- Validation
- Databases
- Indexes
- Code Quality
- Deployment
- Developer Humour
- Feature Flags
- Code Review
- Pull Requests
- Docker
- Cursor
- Authorization
- RBAC
- Gemini
- Long Context
- PHP 8.4
- Caching
- Dependency Injection
- Web Performance
- Browser
- CSS
- Database
- Migrations
- ChatGPT
- AI for Developers
- Monitoring
- On-Call
- REST
- Backend
- SQL
- NoSQL
- Database Design
- Coding Agents
- Claude 4
- API Resources
- REST API
- Load Balancing
- Scaling
- AWS
- AI Tools
- Claude
- Sora 2
- CTE
- 2FA
- TOTP
- Programming Languages
- Prompts
- Developer Workflow
- API Gateway
- APIs
- Passport
- API Auth
- Learning
- Burnout
- Developer Growth
- Web Development
- SEO
- Kate Mall
- ChatGPT Atlas
- Agent Skills
- Middleware
- Laravel 12
- Collections
- Context Window
- Monitoring
- Commit Messages
- Self Review
- Growth
- Regex
- Programming Basics
- Text Processing
- Database Design
- Normalization
- Linux
- Server Security
- Linux Foundation
- Open Standards
- Legacy Code
- Documentation
- AI Workflow
- File Uploads
- Test Data
- Hashing
- Performance
- Caching
- Enums
- Scope Creep
- Estimation
- Codex
- Gemini CLI
- Timezones
- Carbon
- Bugs
- PHP 8.5
- Gemini 3
- GPT-5.1
- Data Integrity
- Event Loop
- Async
- Opus 4.5
- AI Models
- React
- Forms
- Frontend
- Backups
- AI Images
- DALL-E
- Midjourney
- Race Conditions
- Concurrency
- Legacy Code
- Refactoring
- Senior Engineer
- Scope
- LLM
- CDN
- Web
- Sub-Agents
- Soft Deletes
- Audit Log
- Concurrency
- AI Learning
- NestJS
- AI Evals
- Policies
- SPF DKIM DMARC
- Unicode
- UTF-8
- Knowledge Graph
- Value Objects
- Technical Debt
- Feature Flags
- Laravel Pennant
- Deployment
- Copilot
- Composer
- Dependencies
- Artisan
- Automation
- AWS S3
- Object Storage
- Cloud
- Small Language Models
- Ollama
- Production
- Sessions
- HTTP
- Mentoring
- SQL
- Virtual Machines
- Web Development
- HTTP/2
- QUIC
- Web Performance
- AI Integration
- LLM API
- SOLID
- OOP
- Hosting
- Serverless
- Merge Conflicts
- Temperature
- AI Development
- Reverse Proxy
- Nginx
- Infrastructure
- Verification
- Passkeys
- WebAuthn
- Teams
- Communication
- Stakeholders
- Monorepo
- CI/CD
- Versioning
- JSON Schema
- Livewire
- Inertia
- Meetings
- Distributed Systems
- Privacy
- Full-Stack
- T-Shaped Skills
- Money
- Notifications
- Web Security
- HTTP Headers
- CSP
- Function Calling
- Load Testing
- k6
- Data Extraction
- Debugging
- WebSockets
- SSE
- Real-Time
- Laravel Reverb
- Infrastructure as Code
- Terraform
- Side Projects
- Laravel Pint
- OpenAPI
- Swagger
- UX
- Multimodal
- Jest
- Pair Programming
- APIs
- Rate Limiting
- Resilience
- Dev Humour
- Design Tokens
- JWT
- API Keys
- Sessions
- PHPStan
- Rector
- Incidents
- Reporting
- Dashboards
- Zero Trust
- IAM
- Search
- Laravel Scout
- Junior Developers
- Mentoring
- Images
- WebP
- AVIF
- Bug Reports
- Let's Encrypt
- Design Docs
- Software Design
- Observers
- Replication
- Accountability
- Data Structures
- Reliability
- LLM Memory
- Error Handling
- Payments
- Payment Gateway
- Webhooks
- PCI DSS
- Observability
- OpenTelemetry
- Personal Brand
- Writing
- Conventions
- Dates
- Scheduling
- Disaster Recovery
- Compression
- Brotli
- Deadlines
- Developer Habits
- State Machines
- Tech Roles
- UUID
- ULID
- Horizon
- Planning
- Engineering Culture
- Ownership
- Soft Skills
- Socialite
- Cost Control
- Collations
- Unicode
- Octane
- PostgreSQL
What Actually Happens When You Type a URL and Press Enter
About Post
You type example.com, press Enter, and a page appears. It feels like one action. It's actually a relay race with at least six runners, spread across several machines, sometimes several continents, and every one of them can drop the baton.
This is the classic interview question, but I don't care about it for interviews. I care because when someone says "the site is slow", the useful answer is almost never "the site". It's one specific runner in that race. If you have the whole route in your head, you know where to look.
So let's follow one request from the keyboard to the pixels, and at each step note where the slowness hides.
Step 0: The browser checks what it already knows
Before touching the network, the browser asks itself a few questions. Is this a URL or a search? Should it be https://? (If the site sent an HSTS header before, the browser upgrades to HTTPS without even trying plain HTTP.) Do I have a fresh copy of this page in cache? Is there a service worker that wants to answer instead?
The fastest network request is the one that never happens. Good cache headers are the reason a returning visitor can load your page much faster than a first-time one.
Step 1: DNS turns a name into an address
Computers don't connect to names, they connect to IP addresses. So the browser needs to turn example.com into something like 203.0.113.10.
It checks its own cache, then the operating system's cache. If neither knows, the question goes to a recursive resolver, usually run by your ISP or a public service. If the resolver doesn't have it cached either, it walks the tree:
- It asks a root server: "Who handles
.com?" - It asks the .com servers: "Who handles
example.com?" - It asks the domain's authoritative server: "What's the address?"
The answer comes back with a TTL (time to live), which tells everyone how long they may cache it.
Where it gets slow: a cold lookup can take several round trips. That's why each extra third-party domain on your page (fonts, analytics, a chat widget) costs a little. Each one is another lookup, and as we'll see, another connection.
Production tip: lower your DNS TTL a day or two before a server migration. If you lower it at the moment you switch, resolvers will happily keep serving the old IP until the old, long TTL expires.
Step 2: TCP opens a connection
Now the browser knows where to go. For classic HTTP/1.1 and HTTP/2, it opens a TCP connection with the famous three-way handshake:
- Browser: SYN ("can we talk?")
- Server: SYN-ACK ("yes, can you hear me?")
- Browser: ACK ("yes")
That's one full round trip before a single byte of your page is requested. On a fast local network, nothing. Between Doha and a server in the US, very noticeable.
Where it gets slow: distance. No code optimisation beats the speed of light. This is the main reason CDNs exist: they put a server physically closer to the user so every round trip is shorter.
Step 3: TLS makes it private
For HTTPS, the browser and server now agree on encryption. The server presents its certificate, the browser checks it was issued by a certificate authority it trusts and that it matches the domain, and both sides derive shared keys.
With TLS 1.3, this takes one extra round trip (older TLS 1.2 needed two). Reconnecting visitors can sometimes skip part of it with session resumption.
HTTP/3 goes a step further. It runs over QUIC, which uses UDP and folds the transport and encryption handshakes together, so there are fewer round trips before the first request.
Where it gets slow: again, round trips. Also, a misconfigured server that sends an incomplete certificate chain can make some clients do extra work or fail outright.
Step 4: The HTTP request
Finally, the browser asks for the page:
GET / HTTP/1.1
Host: example.com
Accept: text/html
Cookie: session=abc123
User-Agent: Mozilla/5.0 ...
(HTTP/2 and HTTP/3 send the same information in a compact binary form, but the idea is identical.) Notice the cookies: they ride along with every request to that domain, which is one reason giant cookies are a bad idea.
Step 5: The server does its work
This is the part we developers usually own. A typical path for a Laravel app looks like this:
- A load balancer or reverse proxy (often Nginx) receives the request.
- It passes it to PHP-FPM, which boots the framework.
- Middleware runs: sessions, authentication, CSRF.
- The controller runs, queries the database, maybe calls an external API.
- A view is rendered and the HTML is sent back with a status code and headers.
Where it gets slow: this is what Time To First Byte (TTFB) mostly measures. N+1 queries, a missing index, a synchronous call to a slow third-party API, or sending an email inside the request instead of queuing it. If TTFB is high, the problem is almost certainly here, not in the frontend.
Step 6: The browser turns bytes into pixels
The HTML arrives, and the browser starts working before the whole document has even downloaded:
- It parses HTML into the DOM.
- It finds CSS and builds the CSSOM. Rendering waits for CSS, because painting unstyled content and then restyling it would look broken.
- When it meets a plain
<script>tag, HTML parsing stops until that script downloads and runs.deferandasyncexist to avoid exactly this. - It combines DOM and CSSOM, works out the layout (where everything goes), then paints and composites the result on screen.
Every image, font and script it discovers along the way triggers its own mini version of steps 1 to 5.
Where it gets slow: render-blocking CSS and scripts, huge JavaScript bundles that must be parsed and executed, web fonts that hide text while loading, and images with no dimensions that make the layout jump around.
The cheat sheet
| Step | Typical culprit | Usual fix |
|---|---|---|
| DNS | Too many third-party domains | Fewer origins, dns-prefetch / preconnect |
| TCP + TLS | Distance from the user | CDN, HTTP/2 or HTTP/3, keep-alive |
| Server | Slow queries, sync work in the request | Indexes, eager loading, queues, caching |
| Download | Large, uncompressed assets | Compression, smaller images, cache headers |
| Rendering | Blocking scripts, heavy JS | defer, code splitting, less JavaScript |
One mental model to keep
Think of it as find → connect → secure → ask → work → draw. When a page is slow, open the Network tab in your browser's dev tools and look at the timing breakdown of the main request. It literally shows DNS, connection, TLS, waiting (TTFB) and download as separate bars. The longest bar tells you which runner dropped the baton.
Most of the time, in my experience, it's "work". But not always, and that's exactly why it's worth knowing the whole route.
Which of these steps has surprised you the most when you were chasing a slow page?

Be first to comment it...