top | item 43081678

How browsers really load web pages [video]

191 points| todsacerdoti | 1 year ago |fosdem.org | reply

74 comments

order
[+] tovej|1 year ago|reply
Biggest takeaway for me is just how terrible node.js is as a server. Can't say I'm personally surprised, but I think people need to wake up to the mess that moving to self-hosting in javascript has brought. There's no reason to use js outside the browser, there are so many languages that are better suited to build processes and serving content. Testing is different, but why not just run a separate js interpreter specifically for that?

I understand if js is the only language you know, it's tempting to reach for it. But I'm currently actively avoiding js in the toolchain of all my web projects, and my sanity is slowly returning.

[+] user432678|1 year ago|reply
Feeling absolutely the same way these days (with 10+ years of experience with JS). My current breath of fresh air is Go and Swift (despite the fact XCode is the worst IDE I have ever worked with before). Curious what’s bringing back sanity for you?
[+] polishdude20|1 year ago|reply
Wait, what's wrong with it? For all the stuff I've written in Typescript it's been great. And the event loop of JS performs very well as well.
[+] dsign|1 year ago|reply
Also, in case you haven't guessed it yet, all of this can be used to fingerprint a browser's identity--but not a user. In my previous company we had a piece of software that reported all sort of HTTP/2 packet traces, which then we fed to a machine-learning algorithm to know which connections were actual browsers and which ones were bots[^1]. It worked fairly well, but we never had to flex it very hard because it was at a time when most Internet bots were still running in HTTP/1.1 while most actual browsers were running HTTP/2.

A corollary of the above is that image-identification captchas in mainstream CDNs are not what they purport to be, but something darker and weirder.

[^1]: bots not powered by browser automation, that is.

[+] mladen5|1 year ago|reply
I am grateful that he decided to mask himself as clown during this very informative presentation, it helps my sanity in check.

Especially after debugging performance issues on badly maintained nextjs app and not knowing most of this things.

[+] k__|1 year ago|reply
Would be interesting to see if Bun or Deno perform better here.
[+] notarealllama|1 year ago|reply
One of my favorite tech interview questions for any position is, "Describe in excruciating detail, everything that happens when you request and load a website in your browser."

You learn a LOT about how a candidate thinks and the depth of their knowledge.

[+] spps11|1 year ago|reply
i feel this question correlates more with the generation of the SWE more than anything.

expecting current gen SWEs to talk about network layer protocols while answering this is kinda the same as expecting 1990s SWEs to include wire physics and dispersion statistics in their answer to this question.

Depth alone isn't always a good indicator. We have to move on from some of the low level stuff at some point and it is okay for engineers to know in detail about things that have been solved long back.

[+] groby_b|1 year ago|reply
The only good answer here is "breadth first, or depth first"?

If they say "depth first", go all the way down to electrons bumping into each other on the wire.

It's an "I'm so smart, are you so smart" question, the only right approach is a smart aleck approach.

I work on web browsers for a decade+ now, and worked on network protocols for a decade+, and it's not a question I'd consider in any way high signal. If this particular area matters to you, ask a problem in the space. "Web page X doesn't load, figure out why". It shows you way more than "please regurgitate every detail"

[+] what|1 year ago|reply
I assume we have to start with the physical action of typing in a url and everything involved in that? Then how the physical keyboard works? Then how the OS handles the input from the keyboard? Then…
[+] layer8|1 year ago|reply
In former times, this used to be “Describe what happens between pressing a key on the keyboard and the corresponding letter appearing on the screen”. You can go into all sorts of interesting tangents with that topic.
[+] remram|1 year ago|reply
"excruciating details"? I don't think I would ever get to the network if you asked that. I would have to cover how you pressing "enter" gets encoded by the keyboard, how the USB bus works, the interrupt processed by the processor, how that context switch happens, how the next instruction is fetched and decoded by the CPU, how the code for the interrupt gets read, TLB, L1/L2 cache, pipelined execution, microinstructions, transistors, ...

Depth-first doesn't work when the depth of reality is basically unlimited.

[+] LoganDark|1 year ago|reply
How are you requesting the website? Are you typing into the address bar? Of which browser (and what version)? On which operating system (and what version)? On which hardware platform? Have you configured the address bar to also work as a search bar ("omnibox")? Are you typing a domain name or an IP address? Do you have any entries in your hosts file for the domain name? Is the machine configured to resolve hostnames on the local network? Is the domain name one of those? Are you connected to a network? Is your network connection over Wi-Fi or Ethernet? (or something else?) What is your network card and how is it connected? (If USB, which port? If PCIe, which slot?) What other network interfaces do you have? What access point are you using? Do you have a network switch, and if so, which one? Is your internet service over fiber or cable? Which ISP are you using? Gimme a second to look up their peering...

I could go on but :)

[+] gamedever|1 year ago|reply
It depends on the role. I suspect the majority of software developers have no clue. The majority of C, C++, C#, Rust, Java, Python people, really don't know, unless their job deals with the browser. Most game devs don't know.
[+] jiveturkey|1 year ago|reply
i literally am the inventor of this question.

it's an awful question.

[+] hoten|1 year ago|reply
would be fun to do this while stepping through chromium w/ a debugger.
[+] hinkley|1 year ago|reply
The button on your keyboard is depressed, making a connection between two wires. The circuit is made and interpreted by a microcontroller, which differentiates which key press was made based upon…

What? You said excruciating…