From the course: Vanilla JavaScript: Web Performance Optimization APIs

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Receive client hints on the server

Receive client hints on the server - JavaScript Tutorial

From the course: Vanilla JavaScript: Web Performance Optimization APIs

Start my 1-month free trial

Receive client hints on the server

- [Narrator] To make decisions for web performance we know now that there are many information available client-side only, such as the network information API, device memory, save-data, and even responsive queries, such as the current available width, the current device pixel ratio, so the resolution of the screen. But sometimes we need to access that data in the server. For example, to apply some reactive web performance techniques, such as changing the amount of data or the quality of the data that we are sending based on this information. Also, because we might want to serve better responsive images. Such as, the browser is requesting for the picture. Without more information, the server can't say, Okay, let's say we are in an iPhone X We are in a slow 2G, and we have that memory. Well, let's send that version. Another user, oh, this is an Android? It's on 4G, and it has different resolution, and only has two gigabytes of memory. Okay, let's use this version. Or let's compress more…

Contents