Jump to content

Featured Replies

Posted

If lazy load is enable, why not lazy load profile pictures on IPS 4.5?

On some pages there are many profile pictures with big sized images.

Hi,

those are SVG images, which are text and compressed via HTTP Gzip. 🙂

If you mean the uploaded images - good suggestion.

 

Regards,
Thomas

Edited by Thomas P

  • Author
5 hours ago, Thomas P said:

If you mean the uploaded images - good suggestion.

Yes! 😊😊😊

  • 5 months later...

Just bumping this to say that I've been trying to optimize our website with Google Lighthouse, and one of the suggestions is that we enable lazy loading for the user uploaded avatars. See below. So +1 for enabling lazy loading on users' avatars.

image.png.5ff78e75ac36783905b242acb9f079fd.png

After researching about this, browsers have now native lazy loader. We only need to edit the templates to add:

loading="lazy"

To all img tags.

I edited the following templates:

core > front > global

reactionBlurb
reactionLog
reactionOverview
reactionTabs
reputation
userPhoto
userPhotoFromData

This enabled lazy loading for user photos and reactions, and the "Defer offscreen images" warning from Google Lighthouse is now gone! 🙂

(I also made the same edit in my cms custom templates)

Edited by Gabriel Torres

  • 1 month later...

bumping for the incredible tip. This drastically reduces page load times and should be integrated with the lazy load feature in IPS 4.5 or 4.6 when it comes out. Really simple change to the templates made a major difference.

2 hours ago, Paul E. said:

One day, future time traveler, 4.6 will appear. Until that day, here's a plugin that does what @Gabriel Torres documented for you for 4.5.

 

Lazy Load Images.xml 4.95 kB · 4 downloads

Submitted to Marketplace as a free resource for those that like the Marketplace thing:

 

Wow. Nice work! Thank you. Curious to see how this performs. 🙏 

I'm eager/excited for 4.6 too. I'll add to my community later today and see what happens. 🙂 

13 minutes ago, Jordan Invision said:

I'll add to my community later today and see what happens. 🙂 

No idea how it will work with a third-party theme. It's simple theme hooks based on the default theme, and simply adds the loading="lazy" attribute to <img> tags as @Gabriel Torres documented.

On 1/13/2021 at 2:51 AM, Gabriel Torres said:

After researching about this, browsers have now native lazy loader. We only need to edit the templates to add:


loading="lazy"

To all img tags.

I edited the following templates:

core > front > global

reactionBlurb
reactionLog
reactionOverview
reactionTabs
reputation
userPhoto
userPhotoFromData

This enabled lazy loading for user photos and reactions, and the "Defer offscreen images" warning from Google Lighthouse is now gone! 🙂

(I also made the same edit in my cms custom templates)

Thanks, that's great to know!

Presumably the admin cp lazy loading setting has to be enabled for the loading="lazy" code to work?

We are in an odd situation where we actually don't want lazy loading for forum attachments, but would like it in other areas like profile pictures. 

10 hours ago, theipsguy said:

Thanks, that's great to know!

Presumably the admin cp lazy loading setting has to be enabled for the loading="lazy" code to work?

We are in an odd situation where we actually don't want lazy loading for forum attachments, but would like it in other areas like profile pictures. 

You don't need to enable that setting in ACP. It's enough changing the template bits adding the loading="lazy" property 🙂 

On 2/23/2021 at 12:37 PM, Paul E. said:

No idea how it will work with a third-party theme. It's simple theme hooks based on the default theme, and simply adds the loading="lazy" attribute to <img> tags as @Gabriel Torres documented.

I installed it but I'm not sure I see any changes? But that's better I presume than seeing something broken lol 

Looking forward to it being baked into 4.6!

13 minutes ago, Jordan Invision said:

I installed it but I'm not sure I see any changes?

I went to your web site. I had a fight with the thing angry at me that I had an adblocker. Lied and told it I disabled it. It sensed my deceit.

Then I clicked to find a forum post--any forum post. Found one. Conservatorship. Clicked on a topic, and then had a fight with your web site telling me I've had my fill of free content for the day and inviting me to register. While a video played. In the corner. And there were flashing lights.

I tried. 🙂

It should add, in the locations Gabriel Torres mentioned here a loading="lazy" attribute to reaction images, reputation images, and avatars. But, I'm not sure how/if it would work with the custom theme you have installed. There will be nothing visually different, however if you inspect the img tags for those locations, you should see loading="lazy" added, as shown below:

<img src="/path/to/avatar.jpg" loading="lazy">

 

Just now, Paul E. said:

I went to your web site. I had a fight with the thing angry at me that I had an adblocker. Lied and told it I disabled it. It sensed my deceit.

Then I clicked to find a forum post--any forum post. Found one. Conservatorship. Clicked on a topic, and then had a fight with your web site telling me I've had my fill of free content for the day and inviting me to register. While a video played. In the corner. And there were flashing lights.

I tried. 🙂

It should add, in the locations Gabriel Torres mentioned here a loading="lazy" attribute to reaction images, reputation images, and avatars. But, I'm not sure how/if it would work with the custom theme you have installed. There will be nothing visually different, however if you inspect the img tags for those locations, you should see loading="lazy" added, as shown below:


<img src="/path/to/avatar.jpg" loading="lazy">

 

Is this a bad time to say 'Remove your ad blocker and become a member 🤠'

55 minutes ago, Paul E. said:

I had a fight with the thing angry at me that I had an adblocker. Lied and told it I disabled it. It sensed my deceit.

🤣  You cannot hide. 😂

 

Edited by Linux-Is-Best
cleaner video

  • 3 months later...

Recently Browsing 0

  • No registered users viewing this page.