
Lighthouse scores: how to reduce render-blocking scripts - TheMissingPiece
https://fly.io/articles/lighthouse-how-to-reduce-render-blocking-scripts/
======
acconrad
Kind of a lot of words for using Async, Defer, or IntersectionObserver. But
this is a weird case of using IntersectionObserver. I'd rather use it for
something like lazy-loading images[1]. They have a much higher download cost
and will provide a much greater boost in performance than optimizing your
JavaScript. Also, by placing all of your scripts at the bottom (save for a few
at the top like Modernizr), you really don't need to worry too much about
async vs defer.

[1] [https://www.machmetrics.com/speed-blog/how-to-lazy-
loading-i...](https://www.machmetrics.com/speed-blog/how-to-lazy-loading-
images-script-slash-page-load-time/)

~~~
RobertRoberts
It appears Google will be integrating lazy loading into the browser.[0]

In my almost 20 years of development experience, I find my todo list extremely
long. And a core principle that has served me well is that if a feature is
coming to the browsers for free, it's cheaper and easier to wait for the
feature instead of spending real time/money building a cheap copy of it, and
then having to rip it out a year later for the native feature.

"Feature patience" seems a fitting description.

I have recently used IntersectionObserver to replace scroll event
functionality (modifying sticky positioned headers) and it's great for that,
but I don't want to use it for lazy loading, seems like way to much work.

[0]
[https://groups.google.com/a/chromium.org/forum/#!msg/blink-d...](https://groups.google.com/a/chromium.org/forum/#!msg/blink-
dev/czmmZUd4Vww/1-H6j-zdAwAJ)

------
falsedan
> _If this is too many words, the pretty picture below should help clear
> things up._

Holy crap, I knew big G hates users but this level on condescension is off the
charts!

~~~
kaycebasques
I write the Lighthouse docs. This is not one of our docs.

