Iframes optimization

Joined
Apr 23, 2019
Messages
214
Likes
168
Degree
1
For one of my projects, I found that implementing some specific iframes would be a great benefit to my end-user.

Unfortunately, this led to some page speed drops, according to page speed insights.

I found this script that helped me a lot. I'm sure it will be useful to other people. I would advise you to download the script yourself, and modify it for your use, rather than use the link I gave.

Unfortunately, I haven't been able to modify it so that the images would get "clicked" after everything else is loaded and Google is no longer looking at performance. My idea was: use images until everything is loaded, and then go through the iframes on the page and just load the iframes 1 by 1 while the visitor is reading the article.

After a day of trying to get it to work, I decided fuck it. My page speed is still in the high 90s, even without the script.

This is what I tried to fix on page speed insights (came purely from the iframe):

e5fbb54ebf354d3abad6812ce60f84ef.png


It feels like a lost opportunity, but I can't spend all my time on this. Content has to flow. Marketing has to be done!

Hope it helps somebody else. And if you do find a way to make it work, I would love to know!
 
Google never stops looking at the performance, especially if you're talking about lazy loading (based on scroll depth). It will continue to measure things like cumulative layout shift and what not until it hits the bottom, and then they keep listening past that for other activities in the thread.

The invisible text during webfont load isn't really that important. Most of the time it's stuff like social icons or logos where all you'd load behind it is a random letter anyways using CSS. Otherwise you'd have more layout shifting issues. What I'm trying to say is that I don't think Google takes that one all that seriously. It's for accessibility and strangely enough I don't think they care. It's a huge ask to expect normal webmasters to bend over backwards for blind people, when those normal webmasters can't code anything,

iFrames and embeds suck in general. I swore them off and only allowed Youtube in my projects, and then after the giant nightmare I've had trying to use their API to find dead videos, I'm not even using them any more.
 
I'm pretty sure page speed insights gave 0 CLS. The "errors" come from the iframes from an honestly well-made website.
I do feel you on the embeds. They never feel "just right" to me.
The website goes offline, and your pages suffer as well, etc...

Interesting that they keep on tracking the page. That complicates things a bit, but at least I learned something :smile:
 
Back