Skip to main content

Tagged “http”

The “how web requests work” interview question

There’s a classic web developer interview question that goes something like this:

What happens when you type in “bbc.co.uk” into a browser? Describe the journey that results in you seeing a page.

You could answer it like this:

Your browser sends an HTTP request which gets routed through a local modem/router then gets sent to a nameserver. That nameserver routes the request to the correct IP address, which will resolve to some sort of web server. That server will serve up either some static files, or run some backend code in order to generate a resource (probably an html page). When the HTML page is returned, your browser will parse it, which will likely generate more requests, and the cycle will repeat.

To do:

  • add something about HTTPS
  • add more about the front-end aspects: DOM, CSSOM, Accessibility tree, render blocking resources etc

References:

Clear-Site-Data (on MDN)

The Clear-Site-Data HTTP header clears browsing data (cookies, storage, cache) associated with the requesting website. It can even be used to deregister service workers.

As a side note, I wonder if it might be an idea for me to update my website boilerplate to contain pages such as /clear-cookies, /clear-storage, and /clear-all. Then, if someone is having some weird cacheing-related problem on a website I developed, I can simply provide them with a link to one of those pages rather than asking them to hard-refresh or launch incognito windows.

See all tags.