Are Jungian Archetypes Memes?

If 9GAG is the first thing that comes to your mind when you hear the word meme raise your hand! What is a meme beyond that? In this article, I’m going to explore this further, and explain why I…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What happens when you type in a URL in your browser and hit Enter

Every day you open up your browser and navigate to your favourite websites — whether it be social media, news, or e-commerce sites. You go to this page by typing in a URL or clicking on a link to the page.

In this post we’ll go through the steps and processes right from when you hit ENTER to when your browser gives you a page as response.

Firstly, let’s take a look at the relationships and connections between websites, servers and IP addresses.

A websites is simply a collection of files, often HTML, CSS, JS, and images, which instructs your browser how to render the site, images, and data. They need to be made accessible to anyone from anywhere at anytime, so hosting them on your personal computer would not be scalable or reliable. A powerful external computer, always connected to the internet, called a server, stores these files.

The primary purpose of DNS is human-friendly navigation. You can easily access a website by typing the correct IP address for it on your browser, but imagine having to remember different sets of numbers for all the sites we regularly access? Therefore, it is easier to remember the name of the website using a URL and let DNS do the work for us by mapping it to the correct IP. Each device on the internet — PCs, servers, cell phones, your smart refrigerator — all have a unique address called an IP address. IP addresses contains four numbered parts: 198.156.12.14, thus memorising these numbers for each site on the web is a very tedious task.

Using a simpler name such as google.com makes it easier for users to memorise and recall. The DNS then maps this string to the server’s IP
google.com ==> 209.85.227.104, so whenever a user hits enter on google, the browser actually points to the IP underneath.

Firstly, it checks the browser cache. The browser maintains a repository of DNS records for a fixed duration for websites you have previously visited.

Secondly, the browser checks the Operating System’s cache. If it is not in the browser cache, the browser will make a system call to your underlying computer OS to fetch the record since the OS also maintains a cache of DNS records.

Thirdly, it checks the router cache. If it’s not on your computer, the browser will communicate with the router that maintains its’ own cache of DNS records.

Fourth, it checks the Internet Service Provider’s cache. If all steps fail, the browser will move on to the ISP. Your ISP maintains its’ own DNS server, which includes a cache of DNS records, which the browser would check with the last hope of finding your requested URL.

In the event that all caching systems failed to return a viable result, the ISP’s DNS then makes a request to the domain server hosting the given URL.

To help you understand better, I would give a brief overview of domains and its architecture.

Domain Architecture

Many website URLs we encounter today contain a third-level domain, a second-level domain, and a top-level domain. Each of these levels contains their own name server, which is queried during the DNS lookup process.

Requests are sent using small data packets that contain information such as the content of the request and the IP address it is destined for (IP address of the DNS recursor).

Once the browser receives the correct IP address, it will build a connection with the server that matches the IP address to transfer information. Browsers use internet protocols to build such connections. There are several different internet protocols that can be used, but TCP is the most common protocol used for many types of HTTP requests.

To transfer data packets between your computer(client) and the server, it is important to have a TCP connection established. This connection is established using a process called the TCP/IP three-way handshake.

Once the TCP connection is established, data transfer is initiated. The browser will send a GET request asking for www.google.com web page. If you’re entering credentials or submitting a form, this could be a POST request. This request will also contain additional information such as browser identification (User-Agent header), types of requests that it will accept (Accept header), and connection headers asking it to keep the TCP connection alive for additional requests. It will also pass information taken from cookies the browser has in store for this domain.

The server handles the request and sends back a response. The server contains a web-server (i.e. NGINX, Apache etc) that receives the request from the browser and passes it to a request handler to read and generate a response. The request handler is a program (written in ASP.NET, PHP, Ruby, etc.) that reads the request, its’ headers, and cookies to check what is being requested and also update the information on the server if needed. Then it will assemble a response in a particular format (JSON, XML, HTML).

The server’s response contains the web page you requested as well as the status code, compression type (Content-Encoding), how to cache the page (Cache-Control), any cookies to set, privacy information, etc.

Finally, for the browser to display the HTML contents, it will;

Add a comment

Related posts:

Spice up your playlist with these four new sounds this season

When the weather gets cooler and the season changes, there’s a desire for new music, a new sound for the new season. For me, new music is the perfect way to celebrate the change in the season and…