How a Browser Works Flashcards

1
Q

What are browsers based on?

A

Threads AKA a queue that processes tasks sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Previous browsers were single thread. What does that mean?

A

Older browsers like IE6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some of the problems with single-thread browsers?

A

Instability, low performance, insecurity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

With regard to instability, what exactly is the issue with single-thread browsers?

A

You can get a thread crash which leads to a stop in the process and causes the browser to freeze.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

With regard to low performance, what exactly is the issue with single-thread browsers?

A

There are two things that we can potentially attribute to low performance:
1. Javascript takes time, and while it was executing the script, the page render thread waws being blocked.
2. Memory leakage - browser kernel complex. Garbage collection didn’t always work. The longer you used the browser, the more memory was taken from the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

With regard to insecurity, what exactly is the issue with single-thread browsers?

A

Plugins could gain access to the OS with admin permissions via the single thread. Javascript can read sensitive information when you interact with the browser like password input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the primary advantage that a multi-threaded browser has over a single-threaded browser?

A

It can process faster because multiple threads can operate simultaneously. Threads share the date in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the first step in loading a web page, and what are the two primary foes?

A

Navigation is the first step and it occurs whenever a user requests a page by entering a URL into the address bar, clicking a link, submitting a form, etc.

Latency and bandwidth are the two main enemies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Give me a summary of what’s happening when a page gets displayed.

A
  1. The browser process handles user input and composes a URL request.
  2. Network process sends URL request initiating the Navigation phase.
  3. The browser process creates a renderer process after receiving the server response. The renderer process would be on standby at this point while the network process receives the document.
  4. The browser commits the navigation. Network process starts sending document data to the renderer process ending the navigation phase.
  5. The renderer process renders the document.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many steps and how many processes in the broswer are around during the navigation phase?

A

5 steps:
1. Handling user input (BROWSER PROCESS)
2. Sending URL request (NETWORK PROCESS)
3. Prepare the render process (BROWSER PROCESS)
4. Committing navigation (RENDER PROCESS)
5. Rendering page (RENDER PROCESS)

Steps 2-4 are involved in the navigation process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does it mean to handle user input?

A

It all begins with a request for a web page - an HTML request. BEFORE the navigation process begins, the UI (user interface) thread in the browser process will parse the user input. There’s two distinct possibilities when there’s user input:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What’s happening when the user input is a search query?

A

During a search query, the keywords get parsed, a URL with the search query gets composed, and then a URL request is initiated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s happening when the user input is a URL?

A

The address bar will attach protocol (usu. HTTP or HTTPS). For example, medium.com becomes https://medium.com. When the user hits return, the browser reads the URL from the address bar and sends the URL request to a network process via inter-process communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Sending a URL request is part of the network process during the Navigation phase. What’s happening?

A

The first step of navigating to a web page is finding where the assets for that page are located.

The Network process receives the command from the browser process to handle the URL request. First, the network process will take a look at the browser cache - it wants to see if the requested resource got saved locally. IF that resource has been saved locally, it returns the cached resource to the browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens with the Network Process when the requested resource has not been saved locally?

A

If you’ve never visited the site or the assets are not cached, then the browser will request a DNS lookup.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a DNS lookup?

A

The DNS lookup is the process through which human readable domains like sevencups.com get translated into computer-readable IP addresses like 172.67.72.58.

Need to ask Jeremiah about the differences between IPv4 and IPv6 AND why all of the listed IPv4 addresses are in SF. Is it that the server is located in SF? And if so, why isn’t the IP address unique? Are some more current than others?

17
Q

What happens as a consequence of the DNS lookup?

A

Once the browser requests a DNS lookup, it’s eventually fielded by a name server, which in turn responds with an IP address.

After this initial request, the IP will likely be cached for a time, which speeds up subsequent requests by retrieving the IP address from the cache instead of contacting a name server again.

18
Q

Explain the difference between the DNS Record and Name Servers.

A

DNS and name servers aren’t the same thing - DNS is an overarching term for the system that connects computers and services across the internet. Name servers play a role in this system, holding the DNS records that connect a domain name to an IP address.

DNS records and name servers essentially work in tandem: DNS stands for “domain name system,” and DNS records hold the information about which IP addresses match which domains. A name server is a library, and DNS records are the catalog.

19
Q

During a DNS lookup, what can slow the navigation process up?

A

DNS lookups usually only need to be done once per hostname for a page load BUT, DNS lookups must be done for each unique hostname the requested page references. If your fonts, images, scripts, ads, and metrics all have different hostnames, a DNS lookup will have to be made for each one.

20
Q

During a DNS lookup for a mobile phone, what can slow the process?

A

Because a DNS lookup needs to be done for each hostname the requested page references, this can be especially problematic for performance on mobile networks because when a user is on a mobile network, each DNS lookup has to go from the phone to the cell tower to reach an authoritative DNS server. The distance between a phone, a cell tower, and the name server can add significant latency.

21
Q

The whole point in the DNS lookup is to get the IP address. Once the address is known, what happens?

A