 Hello, and welcome to the very first diary entry thing, I think. So today was actually the first day. I actually started coding on the Dev Summit website. And actually, it's been a pretty good day. I took the stuff that we did last week in the supercharged livestream, which was Serma's doing the server-side rendering, because I know I'm going to do a bunch of server-side rendering for the Chrome Dev Summit website. What I need to do is I need to, in the next time I record one of these, I'll show you the designs as well. So you know where I'm headed for now. I just know I've got to get infrastructure set up. So I figured I'll show you a little bit around what I've got going on, which, as it happens, will involve looking at me having written the word index. Apparently, that's as far as I got today. OK, I've done more than that. Let me jump across to the code. So mostly, mostly, mostly, mostly, we have a Travis Yamle file set up. What I've got is this is a bunch of stuff to download and actually host the App Engine thing. I'm also installing Lighthouse, because it's a progressive web app, but it's going to be one. I want to make sure that I'm doing the progressive web appy things. And that's exactly what Lighthouse can do for me. So I have Lighthouse. It then gets a copy of Chrome. It starts that up. And then I basically ask it to run Lighthouse against the Dev Summit site. And then I basically do a bit of a quick validation, which I'll show you, is in here. And all I'm really doing is I open up the JSON file that Lighthouse is spitting out. And then I have a look through it and basically look at the progressive web app bit. And I just add it up and divide it. And if I'm below 0.8, I just fail the build. And because I've got a manifest in there, which I've got a service worker in there, which I'll show you, I should be mostly OK. It'll only be if I break something like that, or if I have a performance regression, maybe. Actually, no, that won't be caught. I should add that in, that it will throw. So that's basically that. And then most of the day has actually gone into the Python stuff. And it apparently wants me to go away. Which mostly is this. Anything that's devsummit slash whatever, I pick up. And in the get, here we are. I basically look at the URL and grab whatever I think it is, which is like, if it's a static file, I basically grab that file directly, which you can see is actually just assumes that it's a straight one-to-one match. And I set those to cache for a year. And then if it's not a static file, so it doesn't begin with slash static, then I basically, at the moment I serve up the single index HTML, which is almost certainly going to change to be per section. But it's fine right now. And I set the HTML to not cache. So while static files are caching for a year, public no cache on the HTML means that the HTML will always be revalidated. And I'll come back to the caching in a moment. And then if it's the service worker, even though I serve it up from static scripts sw.js, I want to appear at slash devsummit so that it can scope and control that whole thing. So that all is working, actually. Let me show you it over here in the network tab. From that, da-da, devsummit is there's the thing. Headers, it's got an e-tag, which I also set further down in the script. Public no cache, which is exactly what I wanted. And then there's a JavaScript file, which has the max age of a year. And that is pretty much what I wanted. And you'll notice, by the way, that there's this big, long hash in the file name. And that is because if it's going to cache it for a year, I need a way to invalidate it. And if it's always called cds.js, then that's not going to work out. Because even if I update the file, it'll still use the old cached one. So I use caching to make sure that if the file contents change, the HTML will get a different path in it. And then it will basically cause the file to be redownloaded, which I do in here. Footer, the footer, you can see me actually doing it. I basically take the path that I'm actually interested and I pass it through a filter called add hash, which is in the Python. Da-da-da, there we are. And that basically reads through the file, updates the hash of a SHA-256 and then substitutes it into the file. So you get like cds.blblbl.js, that blblblbl was the thing. And then on the other side, we basically remove it. So that goes back down to cds.js or whatever the file is that I'm actually interested in. So that means that I've got kind of built-in hashing, which is working just great. So if I change files, they update. Last thing I was going to show you, I do have a couple of static things. One is the manifest.json, which is already filled out with all the Chrome Dev Summit stuff, which is good. And also the service worker, which is the lightest weight service worker that you can pretty much do, which skips waiting. When it gets activated, it claims all clients and on fetch, it responds with a fetch of whatever you ask for. So it's kind of like a pass-through. And I've done this mostly because I wanted to get the lighthouse score high enough that it would fail to build if there was a regression. So it's kind of like a pass-through. And I discovered a Chrome bug in the process. I should show you the Chrome bug, right? Do you want to see the Chrome bug? All right. Let me show you the Chrome bug. I think it's crbug.com648208. That's a guess. I got the ID right. I only did that. Oh. Basically, there's a siren. There's a siren outside. That's London. Right. I've basically discovered that if you set a page to be offline in DevTools and then you make a request that goes via a service worker, the service worker will still be treated as online even if DevTools is set to offline. I think that's a bit weird. I think either Chrome should say that network throttling affects only the page and not anything like a service worker or, and this would be my preference, I think, we extend the network throttling to include service worker. So even if a service worker makes a request, it would be requested with 3G. Problem is a service worker can service multiple tabs. And so which one does it take? It's, I don't know. It caught me out. I filed a bug. We'll see how that one pans out. So that's pretty much my day. Today, that has been pretty much all I got done. Still pretty good. I mean, I could show you in Lighthouse. We'll say that for another time. I've already taken up enough of your time, haven't I? Hey. Now, you can subscribe and you'll get more of these. And obviously, it's gonna get more exciting as we get into the design. But I've got good start, got good caching, a service worker, got a manifest and I've got a Travis file in there to do all the buildy type stuff with Lighthouse. So we're off to a good start. Day one, winning.