Performance and Resilience: Stress-Testing Third Parties by CSS Wizardry

J'étais en Chine il y a quelques semaines pour la journée des développeurs Google et je montrais à tout le monde mon scanner QRCode, cela fonctionnait très bien jusqu'à ce que je passe au mode hors connexion. Lorsque l'utilisateur était hors ligne (ou partiellement connecté), la caméra ne démarrait pas, ce qui signifiait que vous ne pouviez pas prendre de code QR. Il m'a fallu un certain temps pour comprendre ce qui se passait, et il s'avère que j'ai démarré la caméra par erreur lors de mon événement onload et que la demande de Google Analytics était bloquée et non résolue rapidement. C'est ce commit qui l'a corrigé.

Because these types of assets block rendering, the browser will not paint anything to the screen until they have been downloaded (and executed/parsed). If the service that provides the file is offline, then that’s a lot of time that the browser has to spend trying to access the file, and during that period the user is left potentially looking at a blank screen. After a certain period has elapsed, the browser will eventually timeout and display the page without the asset(s) in question. How long is that certain period of time?

It’s 1 minute and 20 seconds.

If you have any render-blocking, critical, third party assets hosted on an external domain, you run the risk of showing users a blank page for 1.3 minutes.

Below, you’ll see the DOMContentLoaded and Load events on a site that has a render-blocking script hosted elsewhere. The browser was completely held up for 78 seconds, showing nothing at all until it ended up timing out.

Lire l'article complet.

Je vous encourage à lire le post car il y a beaucoup de perspicacité.

About Me: Paul Kinlan

I lead the Chrome Developer Relations team at Google.

We want people to have the best experience possible on the web without having to install a native app or produce content in a walled garden.

Our team tries to make it easier for developers to build on the web by supporting every Chrome release, creating great content to support developers on, contributing to MDN, helping to improve browser compatibility, and some of the best developer tools like Lighthouse, Workbox, Squoosh to name just a few.