Note from 28 June 2021
Rhetorical WebPerf question: is it better to have a low or stable Cumulative Layout Shift? 😅
-
older note:
Note from 28 June 2021 -
newer note:
Note from 6 July 2021
Rhetorical WebPerf question: is it better to have a low or stable Cumulative Layout Shift? 😅
I have a client site with a header that is hidden when the user scrolls down, but shown again when the user scrolls up, which seems pretty comon nowadays.
This triggers some CLS, even if the hide/show is done in less than 500 ms, as “continuous interactions such as scrolls, drags, or pinch and zoom gestures are not considered ‘recent input’”. 😞
Priority Hints and optimizing LCP
Increasing the priority of a resource usually comes at the cost of another resource, so Priority Hints should be used sparingly. However, if the browser is queuing your LCP image, I recommend you experiment with Priority Hints to see if you can reduce this waiting time and improve your LCP.
Of course we don't work on performance improvements only for Google, but the Search Console is our clients' main concern, so when it shows such a graph, it's satisfying for everyone! 🎉
If you use #Eleventy and know how to add fetchpriority="high"
on your Largest Contenful Paint image, I made a plugin that adds a <link rel="preload"…>
for it, even it it's responsive: https://github.com/nhoizey/eleventy-plugin-auto-preload
Feedback welcome! 🙏
width
and height
attributes on <img>
help prevent layout shifts (CLS). Values should be unitless integers.
But #Lighthouse sees 100%
as 100
, thanks parseInt()
…
Do you think it should be improved?