lazy-load-for-videos
                                
                                 lazy-load-for-videos copied to clipboard
                                
                                    lazy-load-for-videos copied to clipboard
                            
                            
                            
                        Cache thumbnails for faster Lazy Loading
Hello, it would be great to determine the thumbnail for each video (and embed the red youtube button, or other choice) one time only, and store that file locally. Then on next page load, if the file is detected (in some well-named/organized spot) it would not have to go and fetch a new thumbnail (which is generally not changed) on each page load. I realize there is a quality determination for the thumbnail, but that could still be supported by downloading several, and still run the test to select locally.
I'm willing to try and implement this if you could let me know how you would recommend doing this.
Thanks!
Hi Jeff, that's a nice idea. I'm just not sure if that is worth the effort.
- Caching the red Youtube button might be handled by the web browser already [guess].
- Caching thumbnails is in so far not necessary because the majority of sites doesn't have the same video and thumbnails on more than one or two pages [hypothesis].
I won't spend more time thinking about this but feel free to make it working for your site and to send a pull request.
Hi Kevin,
Ok, so I guess the name of the file being 0 is the big problem here? That's easy to fix, of course. Name the thumbnail the same as the video URI. Then it is unique across the web.
The reality is that this part of the lazy load isn't lazy at all, and it ends up taking time and resources which are unnecessary. Even the DNS query takes time. And time, my friend is money.
Sorry, I don't get it. Please give a more specific example, provide a link to a page where I can see that behavior, and, ideally, submit a pull request.
Bumping this as I've got the same issue here.
- Thumbnail images aren't lazy loaded, they're loaded as background-images on page load.
- Thumbnail images are hotlinked from a CDN with a low expiry time, which effects page speed scores.
Is it possible to 'capture' and modify the output of the plugin? If so I'd write my own functionst to modify the output myself.
I plan to work on this in the next months by server-rendering the thumbnails instead of injecting it into the page using JavaScript.
Sweet. We ended up forking the plugin to download a local copy (into /wp-content/uploads/llfvcache/ or something) of each thumbnail and serving from there.