futtta / wp-youtube-lyte

Embed YouTube on WordPress for optimal performance
24 stars 10 forks source link

Add option to disable lazyload for content above the fold #41

Closed danielbald closed 1 month ago

danielbald commented 1 month ago

Can you add a feature to selectively, ie a shortcode option, to disable lazy load?

This is to keep PageSpeed happy as it will reduce LCP.

futtta commented 1 month ago

When on mobile by default LYTE's are replaced with the real YTembed soon, so that means that the LCP is the YT video itself. ticking the "cache thumbnails locally" will change LYTE's behavior for mobile into the one for desktop; not loading the YT vid until being clicked on so that would help LCP.

For the images in a LYTE vid (placeholder) are loaded as background image, so they always indeed load with somewhat lower priority. disabling LYTE as a whole for above the fold videos would have an even bigger impact on LCP (as described in previous paragraph), so not sure if there's a (somewhat simple) solution for that.

On Mon, Sep 30, 2024 at 10:53 AM Daniel Bald @.***> wrote:

Can you add a feature to selectively, ie a shortcode option, to disable lazy load?

This is to keep PageSpeed happy as it will reduce LCP.

— Reply to this email directly, view it on GitHub https://github.com/futtta/wp-youtube-lyte/issues/41, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABMIMJYMDVALNLUU6LBRG3ZZEGQFAVCNFSM6AAAAABPCZD3AOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TKOJZGQ3DCNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

danielbald commented 1 month ago

Thank you very much for such a fast response. That makes sense. I've enabled local cache.