見出し画像

What will happen when you open an URL in a browser?


When you open a URL in a browser, the following things will happen


  1. The browser will first check its cache to see if it has a copy of the website's code. If it does, the browser will use the cached code to render the website.

  2. If the browser does not have a copy of the website's code, it will send a DNS request to a DNS server to find the IP address of the website.

  3. Once the browser has the IP address of the website, it will establish a TCP connection with the website's server.

  4. The browser will then send an HTTP request to the website's server, requesting the website's code.

  5. The website's server will send an HTTP response to the browser, containing the website's code.

  6. The browser will then render the website's code, displaying the website to the user.

Here are some additional details about each of these steps:

  • Cache: The browser's cache is a temporary storage area for web pages that the browser has previously visited. This allows the browser to render web pages more quickly, as it does not have to download the page's code from the website's server each time.

  • DNS request: A DNS request is a request to a DNS server to find the IP address of a domain name. The DNS server will then return the IP address of the domain name to the browser.

  • TCP connection: A TCP connection is a connection between two computers that uses the Transmission Control Protocol (TCP) to ensure that data is transferred reliably.

  • HTTP request: An HTTP request is a request to a web server for a resource, such as a web page. The HTTP request will contain the resource that the browser is requesting, as well as other information, such as the browser's IP address.

  • HTTP response: An HTTP response is a response from a web server to an HTTP request. The HTTP response will contain the resource that the browser requested, as well as other information, such as the status code of the response.

https://example.com/product/electrnic/phone

https is Schema
example.com is Domain 
product/electrnic/ is Path
phone is Resource 



Reference 


https://www.freecodecamp.org/news/what-happens-when-you-hit-url-in-your-browser/

この記事が気に入ったらサポートをしてみませんか?