Advertisement:

Author Topic: Lazyload  (Read 458 times)

Offline alexetgus

  • Sr. Member
  • ****
  • Posts: 706
  • Gender: Male
    • alexetgus on Facebook
    • alexetgus on GitHub
    • @alexetgus on Twitter
    • Chez oim, forum libre !
Lazyload
« on: April 25, 2020, 04:06:56 PM »
Lien vers le mod

Lazyload

Lazy loading (Lazyloading) for images displayed in SMF messages.
This mod is compatible responsive design.



Description:

This modification (for SMF 2.0 Final only) adds a feature allowing posts images to be loaded only when they are needed.
If an image is not in the display window, it is not loaded.
The display of a page thus becomes faster.

This feature is essential for mobile phones that are charged by the amount of data they consume.



For more information on the JavaScript used, please visit the project's Github repository :
https://github.com/aFarkas/lazysizes


https://chez-oim.org  -  This mod is copylefted
To contribute : https://github.com/alexetgus/lazyload

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,530
  • Gender: Male
  • Learning more every day!
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Lazyload
« Reply #1 on: April 25, 2020, 06:00:59 PM »
I had tried this a while ago and it works quite well for a while, out of nowhere I stop working it's time to try it again... Great job I will comment on anything!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2020
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 31
Re: Lazyload
« Reply #2 on: May 04, 2020, 12:50:46 AM »
Holy ****** this is just what I needed google pagespeed insights always pings me on my images
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!
http://www.agoraroad.com/macforum/index.php

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 31
Re: Lazyload
« Reply #3 on: May 10, 2020, 03:23:10 AM »
would there be any updates to have lazyloaded avatars and board icons?
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!
http://www.agoraroad.com/macforum/index.php

Offline alexetgus

  • Sr. Member
  • ****
  • Posts: 706
  • Gender: Male
    • alexetgus on Facebook
    • alexetgus on GitHub
    • @alexetgus on Twitter
    • Chez oim, forum libre !
Re: Lazyload
« Reply #4 on: May 10, 2020, 04:02:20 AM »
Yes it's possible, that's what I did on my site (images, avatars and smileys)

I only proposed the images, but I can create several versions of the mod according to the desires of each one.

There's no need to do it for board icons, it's the caching that does the job. No need for lazy loading.
Of course, one must be interested in the caching of the resources of its forum. This is a very important point!
« Last Edit: May 10, 2020, 04:40:58 AM by alexetgus »

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 31
Re: Lazyload
« Reply #5 on: May 10, 2020, 02:34:41 PM »
Can you please tell me what did you put it in the code? I tried doing it last night but it failed. And I have level 2 cahcing but I have special board icons which google pagespeed insights tells me I should lazy load them.
Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!
http://www.agoraroad.com/macforum/index.php

Offline alexetgus

  • Sr. Member
  • ****
  • Posts: 706
  • Gender: Male
    • alexetgus on Facebook
    • alexetgus on GitHub
    • @alexetgus on Twitter
    • Chez oim, forum libre !
Re: Lazyload
« Reply #6 on: May 11, 2020, 10:25:03 AM »
Stop listening to Google like he's always right.
This is often wrong and it will not harm your SEO!

For avatars, look in the file Load.php, Display.template.php et MessageIndex.template.php
For smileys, it's in the file GeneriControls.template.php

And stop listening to Google! He's not always right...
If you keep listening to him like a schoolboy, you'll do something stupid!...