- This topic has 3 replies, 2 voices, and was last updated 8 years ago by
Tom.
-
AuthorPosts
-
May 21, 2018 at 1:34 pm #581111
Burt
Hey, Tom and gang –
I’ve been experimenting with speeding up sites using Chome LightHouse and one of the ways has been replacing as much jQuery as I can.
I’ve been looking for a lightweight javascript for lazyloading images, iframe, and other objects. I came across this one and it seems to work extremely well.
https://github.com/aFarkas/lazysizes
I understand that you want to keep GeneratePress as lightweight as possible. I was wondering that perhaps this lazyload can be added to the premium version with the ability to change out src to data-src.
Thanks again for such an awesome framework (-;
May 21, 2018 at 8:57 pm #581333Tom
Lead DeveloperLead DeveloperHi there,
Thanks for the suggestion! So would this library be added to the featured images within the theme?
May 22, 2018 at 1:15 pm #582050Burt
Hey, Tom, I’ve been trying to get landing pages to get in the <3second range on 3G and both of these test pages I was able too
1.> http://betaelite.wpengine.com/n/14-copy.php
and
2..> http://betaelite.wpengine.com/n/15.php these don’t have the minimum wp loaded yetSince the library is super small http://betaelite.wpengine.com/n/inc/lazysizes.min.js
I was thinking that it be a module in the Generate Press plugin – lazyload ( has a simple API ). Then if selected to turn on lazyload for images:
- go in and update all attached images to have a lazyload class and data-src with the image URL
- use the image_send_to_editor filter to do the same for all new images being added
- As the API allows for iframes and posters to be lazyloaded along with other objects too – this can be done at a later date
- Able to reverse the process ( though would it be bad to have the extra data-src on?
- Also, the API supports image src-sets and you can have sized responsive images
Haven’t really flushed it all out but so far it is the lightest weight, non-jQuery lazyload script that works with a very easily understood API that seems to be future-oriented.
May 22, 2018 at 8:52 pm #582254Tom
Lead DeveloperLead DeveloperI actually think this would be a great idea for a plugin, as it would work regardless of the theme. I’ll definitely keep it in mind 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.