DEV Community

Cover image for What Actually Happens When You Press Enter After Typing a URL?
Jino R Krishnan
Jino R Krishnan

Posted on

What Actually Happens When You Press Enter After Typing a URL?

Understanding the journey of a web request from your browser to a web
server.

Every day, millions of people type a website address into their browser,
press Enter, and expect a webpage to appear almost instantly.
Whether you visit Google, GitHub, or DEV Community, the experience feels
effortless. Behind this simple action, however, lies a carefully
coordinated sequence of events involving your browser, your operating
system, networking protocols, routers, servers, and databases.

This article follows that journey from beginning to end.

Understanding the URL

Consider the following URL:

https://example.com/products?id=15

Before the browser communicates with the Internet, it first understands
what you have typed.

  • https tells the browser to use a secure connection.
  • example.com identifies the website.
  • /products identifies the resource being requested.
  • id=15 provides additional information for the server.

Only after interpreting the URL can the browser decide what to do next.

Checking the Browser Cache

The browser first checks whether it already has the requested resources
stored locally.

Modern websites reuse many files such as images, stylesheets, fonts, and
JavaScript files. If these files are already available in the browser
cache and are still valid, they can be reused immediately. This reduces
network traffic and improves page loading speed.

If the required resources are not available, the browser continues with
the next step.

Finding the Server

The browser understands the website name, but computers communicate
using IP addresses rather than names.

To discover the server's address, the browser performs a DNS lookup.
example.com -> 93.184.216.34

DNS acts as the Internet's directory service by translating
human-readable domain names into IP addresses.

Readers interested in learning more can refer to my dedicated article
explaining how DNS works.

Establishing a Connection

Once the browser knows the server's IP address, it establishes a TCP
connection.

Before exchanging data, the browser and server perform the TCP three-way
handshake.

Browser                 Server

SYN ------------------>

      <--------------- SYN + ACK

ACK ------------------>
Enter fullscreen mode Exit fullscreen mode

This process confirms that both systems are ready to communicate
reliably.

Securing the Communication

Reliability alone is not sufficient. Information exchanged over the
Internet must also remain private.

For this reason, modern websites use HTTPS.

Before sending the request, the browser and server perform a TLS
handshake to:

  • verify the server's identity,
  • establish an encrypted connection,
  • protect data from interception.

After the handshake completes, all communication is encrypted.

Sending the HTTP Request

The browser now sends an HTTP request.

GET /products?id=15 HTTP/1.1
Host: example.com
Enter fullscreen mode Exit fullscreen mode

This request tells the server which resource is being requested.

Travelling Across the Internet

The request leaves your computer and passes through several networking
devices before reaching the destination.

  • Your Computer
  • Home Router
  • Internet Service Provider
  • Internet Routers
  • Destination Network

Each router forwards the request closer to the destination until it
reaches the server.

The Role of Content Delivery Networks

Many websites use a Content Delivery Network (CDN).

If the requested content is already available on a nearby CDN server,
the CDN responds immediately without contacting the origin server.

If the content is unavailable, the request continues to the website's
infrastructure.

Using CDNs significantly reduces latency and improves user experience.

Processing the Request

After reaching the website's infrastructure, the request commonly passes
through several components.

  • A load balancer selects an available server.
  • A reverse proxy forwards the request.
  • The application server executes the business logic.
  • If necessary, the application retrieves information from a database.

Once processing is complete, the server prepares an HTTP response.

Returning the Response

The response contains the requested content, which may include HTML,
CSS, JavaScript, images, fonts, or JSON data.

The response travels back across the Internet to your browser using the
same networking principles.

Rendering the Webpage

Receiving the response is not the end of the process.

The browser must still build the webpage.

It performs the following tasks:

  1. Parses the HTML document.
  2. Downloads additional resources.
  3. Applies CSS styles.
  4. Executes JavaScript.
  5. Draws the final webpage on the screen.

Only after completing these steps does the webpage become visible.

The Complete Journey

  • User Presses Enter
  • Browser Parses URL
  • Browser Cache
  • DNS Lookup
  • TCP Connection
  • TLS Handshake
  • HTTP Request
  • Internet
  • CDN (optional)
  • Load Balancer
  • Reverse Proxy
  • Application Server
  • Database
  • HTTP Response
  • Browser Rendering
  • Webpage Displayed

Conclusion

Loading a webpage is far more than sending a request to a server. It is
a carefully orchestrated process involving networking, security,
caching, routing, server infrastructure, and browser rendering.

Although this entire sequence usually completes in less than a second,
it represents decades of engineering innovation working together to
deliver information with remarkable speed and reliability.

Top comments (0)