- [Instructor] Web performance optimization is a set of practices to improve perception of how fast the website, or the app, is being loaded. Increasing perception will increase conversion, so it will make more money for the company, it will make more visitors, more page views, or whatever conversion means for that particular site. In the last few years, new user-centric metrics and new goals have appeared, that now, we need to achieve. For example, we have first meaningful paint that the current goal is from one to three seconds, meaning that we should show something meaningful to the user within the first three seconds.
Then, we have first interactive, that is typically two to four seconds. That means, we don't want to see something only. We want that something to work, to actually work, and for that, it should be interactive. Sometimes you see a page on the screen, but it's not working, you try to click, you try to scroll, and nothing happens. So, that's because first interactive didn't happen yet. So, typically, when we are doing web performance, we are developing the app, we measure performance, and then we say, oh, let's apply some techniques here, and then we develop that, measure, apply techniques, and so on, that's basically how, typically, web performance works.
At one point, we say, okay, we are ready to deploy. We deploy, and we go to the user. So then, the user will get that optimized website. So, what's the problem, then, with this? We are thinking that web performance is something static, that after we have applied techniques, we are done. The problem is that the real web performance out there is based on users' contexts. For example, the user may be on an iPhone X on a Wi-Fi connection, or it can be a laptop using 3G, there are laptops with cellular connections.
We can be a Moto G, an Android device, 4th generation, so let's say two to three years old, and it's currently on a bad LTE connection, so it's a 4G, but it's not working properly with that connection, because the user can be on a bath. It can be a Google Pixel 3, so a very modern Android device, but it's on roaming, and it's on 2G, or it can be an Android Go, so, low CPU, low memory, but on 4G. So, different contexts, and we still need to achieve all our goals, but it's not possible within a static analysis to get and achieve the same goals on every context.
- Understanding the Performance APIs
- Navigation Timing
- Calculate milestones in the Performance Timeline
- Measuring the timing of navigation, resources, servers, and more
- Reading network and device information
- Optimizing code