- This topic has 3 replies, 2 voices, and was last updated 3 years, 4 months ago by Tom.
May 21, 2018 at 1:34 pm #581111Burt
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 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 (-;GeneratePress 2.1.2GP Premium 1.6.2May 21, 2018 at 8:57 pm #581333TomLead DeveloperLead DeveloperMay 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
Since 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 #582254TomLead DeveloperLead Developer
I 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 🙂
- You must be logged in to reply to this topic.