Help Interpreting Waterfall Results - Long Task

Hello Fellow Website Optimizers!

So I’ve been optimizing my website and think I have it pretty good. It gets a perfect rating on google pagespeed insights (lighthouse), and My only main weakness is TTFB as I’m currently self-hosting my site from home on a Synology NAS (protecting my origin IP with CloudFlare). I’ll fix my TTFB soon when I move the hosting.

However, my results show a long ~1.2 second delay between first contentful paint and “fully loaded”.

I’m using the super popular “lazysizes” JS library to lazy load images on the site. The last 2 requests you see are lazy loaded images. However why such a long delay? It seems the browser main thread is mostly idle. Bandwidth is 0. Cpu utilization low-ish.

What does the long green bar on the bottom right of this waterfall mean?

Ok, while waiting for my post to be moderated, I actually solved my problem (or at least understand it).

The lazysizes JS deferred image loader has a weird “feature” where it insert a +1 second delay if your page onload event is faster than 1 second.

Excerpt from lazysizes source code:

[code]var onload = function() {
if (isCompleted) {
if ( - started < 999) {
setTimeout(onload, 999);

isCompleted = true;

lazySizesCfg.loadMode = 3;


addEventListener('scroll', altLoadmodeScrollListner, true);