 It's a bit cut off at the bottom. Control minus. Maybe I can set my screen. So, yeah, this is for the nudes out there, I guess. What resolution is the screen? Does anyone know? That's a bit small. Anything? Computers, man. Sometimes I wish I could just run free in the forest, you know what I mean? Hunt things. I'm tired of this bullshit. Okay. Okay, someone. Okay, so... Alright, so you started a go-lane project for no reason in your workplace. Just for fun. Just for fun, that's why I started this project. So that I could ruin the lives of my fellow colleagues by introducing a new language into the mix. Just as you do. Yeah, so no one else has done that. Ruin the life of your colleagues. Actually, it's not so bad. There's some good news. And secondly, okay, so I'm hoping you guys are all engineers just coming up with food. And you administer maybe a website, a web application. Who knows about SEO? So, this project is all about SEO. Basically, my boss said to me, our website isn't on this thing called Google. Have you heard of it? And we need to improve our Google ability, whatever it's called. And then after looking at the site, it's easy to understand why it doesn't get any Google help. And then this talk is about using go-lane to prove the SEO of this website in question. So let's... Does everyone know what statically generated HTML is? Who doesn't, maybe? Oh, God. Get out. Okay. So, actually, the order of my talk has probably messed up because I just did it very quickly. The important thing, Ruin... What the hell is this Ransnet thing? Oh, shit, wireless... We're screwed. We're screwed. Basically, that was... Oh, no. What have I done? Help. Help. I just want to go to that forest. I want to go to the forest. Okay, basically, I don't have internet. That's going to go just fine. Okay, the big reason why I'd have studied HTML is that you can put that study HTML on S3, which can be on CDN, and that means your website will be incredibly fast. Who doesn't... Okay, so as you may or may not... I mean, who has like a Node.js or a PHP-driven application? Okay, there's one loser. Most people... Most people are losers. Listen. I said that you're a loser, guys. Because most people don't have the HTML and JavaScript on... Stakely, on S3, on CDN. But most people are not functional guys like you. I'm not functional. I'm the opposite of functional. I hate functional people. I'm the guy in the computer science department beating up the guys in the scheme. I hate those lambda asshole people. So, what are we going to talk about again? Fast. So basically, a lot... I see what's very popular on the web world is something called isomorphism. Does anyone know what the hell that is? No. One guy. There's always one guy. He's just putting his hand up for no reason. Isomorphism basically is saying that it's basically saying that when a Googlebot, when something basically doesn't have JavaScript support, it can actually see the page for what it's supposed to be. But in reality, that's a really sick joke. And for my employers, and I'm sure for a lot of people out there who don't want to admit it, they use some horrible hacks like using phantom.js to serve a JavaScript website. It's a terrible idea. Don't do it. Static HTML, guys. And then GoLang. Yeah. Is there a better way to generate static HTML other than GoLang? Because GoLang has some sweet features. A, that it's fast. And B, that it does this automatic contextual escaping. I don't know. I don't know what it is. I just saw it. I thought it was one other thing. If I had internet, I would have followed this link. Basically, is there something faster than GoLang for generating templates? I mean, there's a whole bunch of ways to generate templates. There's like Python away, the Java way, the Ruby way. But I, which is fastest. I mean, there's probably, I bet you my make file with M4 is probably faster than GoLang. But I won't tell you that one. Forget it. I said, I think GoLang is the fastest. I haven't done any tests. This is the way I roll. No test data. Bad boy. Bad boy for life. But it's really, really fast. So, what, and then automatic contextualization goes, I hate that. I hate saying that. Is that, as you wait, well no, if you build a web application, the URI has to be escaped a different way and the code is embedded. The ampersand has to be escaped to ampersand, depending on the context. And most people, most people screw it up. I mean, how many times have you put ampersand in an input field and you see, like, it expands into something stupid? But this doesn't automatically. So you don't even have to think about it very hard. This is what, this is my first slide, which I sort of started. So, most, most modern 2016, 2016, yeah, hopefully this will change. This is what my website, this is what my employer's website actually looks like. And if you go around the Internet, a lot of websites look like this. Who has a website that looks like this? They just serve a bundle.js. You're winners. You're winners. You're doing it the right way. Not on a joke. You're doing it the wrong way. So basically, when the Google box sees this, it basically sees a blank page. There are some people who are idiots in this world. There's many of them. My computer, like, for example, my parents, they're really shit at computers. But there's also other people who are my age who say to me that, no, no, no, Googlebot can understand JavaScript. No, it can't. When it's like a five megabyte bundle, do you think the Google box is going to download the five megabyte bundle instead of rendering a whole frickin' stupid ass web application? That's not going to happen. Okay, so this is what most websites look like. So let's make it a little bit better. And the good way to start is, I think, looking at the sitemap.txt. Does your website have a sitemap? I thought it should have a sitemap. It makes it really easy for Google. It's probably lazy at this point. So a good thing to do is, if my internet was working, I would click this and show you a sitemap. So basically, I don't know, ThoughtWorks.com, the hosts of this thing. And they probably have ThoughtWorks.com slash careers, contact us. Those are good candidates to make static. So my advice to you is just plan your roots or your URLs with the sitemap.txt. And then what I'm trying to say here is that you don't have to make everything a static thing. And obviously a lot of web applications with React.js frontends are quite dynamic. You can't make the whole thing static, but you can mix and match and do some of it. And some of it will go a long way, in my opinion. Most websites with the React.js frontend have an API backend. And to make things easier, you use this tool that helps you convert the JSON responses that you get from API into a GoLang struct. And then also don't forget to put training slashes on your paths so that you don't have to do an expensive redirect when you're hosting on a static site. I include this little screenshot because this shows you that when you're using CloudFront, you can set up all sorts of behaviors, but the common behavior that I use at work is that if it doesn't find a static root, it just goes to 4.4.html, which looks like the previous slide. And that bundle.js basically boots up dynamic routes and things like that. Anyway, it works well. It really does. It works really, really well. Obviously, I hope you guys do this. Everyone knows PageSpeed Insights, don't you? Everyone? Yes. No one? Yes. I see one person nodding. There's also this cool tool called Curl. You can just put time in front of it. This HTTP ping, which is a C++ monstrosity. I'm actually not using that so much. This is a new tool called HTTP stat, which is quite cool. It tells you, like, when you make a request, it tells you your DNS lookup is 10 milliseconds and your established TCP thing was 100 milliseconds, and it tells you the whole thing, your request. And obviously, if your requests are anything, if your channel requests are more than 100 milliseconds, I'd say you have a problem. A request should take less than 100 milliseconds. And ideally, around the world, it should be less than 100 milliseconds. So don't just test, like some people do at some of my workplaces in Singapore, think, we haven't got a problem. We haven't got a problem. It's fast here, but hello. It's shaped to a machine in India or something like that, and you'll be surprised how crap it is. And there's a new tool called Lighthouse by Google, Chrome or whatever, and that also measures how fast your site is and all the rest of it. Yeah, so most of this stuff is kind of probably basic to you guys, but I'm going to show you some code anyway just so that you can sleep well tonight thinking about my code and how boring it was. So you can do quite... To write a static go, what do you call it? Generator thing. It's really quite simple, but some people will screw that up and make it more complicated than it should be. I put that code in there just to show you how perhaps not to do it. But this is the better one. You can just... What is this? Ten lines of code, and it's pretty much quite a robust static generator. All you need to do is replace that to the files or the parts that you generated stuff, and then the structs that you feed in here are responses from your API. And boom! You got yourself a static website. Did you then put on to S3 and the rest of it? So I wanted to show you that it's easy to do complicated templates. I put this on my GitHub if you want to have a look. I just find that people for some reason don't get going as fast as they should. Obviously, with any template you can include the header and the footer. There's actually another thing that people get stuck by is the weird way things get passed around. For example, if I run this, the title doesn't get filled in. So what needs to happen? The 404 actually is the index for the whole site. I know it doesn't really make sense when you think about it, but it does when you're working with S3. So this is... With this dot, for example, that's how you pass your struct into an include. So that the title is filled in and all that sort of stuff. Is there anything more to say about this? It's fast? If you can find a faster way and a better way of doing this, let me know. But I think Golang can't be beat. Hamel? Okay. No, it's slower, guys. Ruby's slow. Rust, I doubt it. I doubt it. So it's like, yeah. It's dead simple. It's really, really simple. There's lots of things about templates people get confused about. Naming them, you don't need to name them. You can just use files. For example, just write out the 404.html which is in there. It's really simple. This is it, man. This is pretty much my static sign generator. It sounds really cool, doesn't it? That's it. That's my talk, pretty much. No, wait, wait, wait! There's more! Okay, so I use the same sort of crappy style for most things I do. If you have problems sending your struct around, you need that dot which you hardly can see. I have a blog that uses the same sort of style. I have an image viewer which uses the same template. And I also have this TOAC. This is quite cool. It's called the Table of Contents. Back in the old days when people had books, right? There's like this section in the front. And it has like the pages and the different chapters. So all this thing does is go through like the headers and then builds up a table of contents. So if anyone, how many of you have a fact on your website or something like this? If it doesn't have anchors, I hate you. Every question should have a permanent or something. Is permanent still used? Yeah. The stuff falls on my GitHub account. Please have a look. And this is the last slide where you can stare into oblivion, pretend this pain didn't happen to you. And any questions? If I had internet, I would probably do some HTTP stats to show you how much faster the site is. Basically, the site at my company was like, I don't know, it was like a Node.js server here in Singapore. We have actually fully transitioned. We will do very soon. But obviously, when it's all statified or whatever it's called, it's less than 100 milliseconds pretty much all around the world. It's a huge boom. If there's anything better than CloudFront, please let me know. It's bullshit. And my company even has a blog. ID, that's what I do when I'm really bored. People don't bother me when I'm gone. Dev Ops is what's still to come. That's all guys who are employing me and pay me.