Let’s be concrete. Below is a YouTube video served with SlimFast, our WordPress plugin.
SlimFast is a minimalist lazyloader that makes your video pages slimmer and faster. It replaces heavy YouTube iframes by their thumbnail. Look again at the above video. It’s not obvious at the first glance, but what you see is not a YouTube iframe. It is just a YouTube video thumbnail with a play button over it! This trick allows to load your page much faster.
How to use this plugin?
- Download and activate it from WordPress
- Paste the url of the YouTube video in a page (for example https://youtu.be/neV3EPgvZ3g). WordPress will convert it into a video iframe. SlimFast will take it from there and replace the iframe by the video thumbnail and a button to play the video. This will also work for all pre-existing videos embedded this way.
What is lazyloading and why is it important on YouTube videos?
Lazyloading is a technique to make your pages load faster, by only loading required elements when the visitor requests them. The page speed is a key element in Google’s algorithm to rank pages.
Embedding a YouTube iframe will load a lot of scripts for every single video and will slow down your page, especially if your visitor doesn’t have a top connection. Hence the need for lazyloaders!
2 types of lazyloaders exist:
- Those who load the video iframe when the visitor scrolls down to the point where he sees the video on his screen.
- Those who load the iframe after the visitor clicks the Play button. SlimFast is one of those. We believe it is the best approach to let your visitor decide if he wants to click or not, and only load the iframe if he clicks.
Why is SlimFast better than other YouTube lazyloading plugins?
- Because they require 2 click to play a video: 1 to load the iframe, 1 to play it! This is actually the reason why we built this plugin: SlimFast loads & play videos with 1 single click, even on mobile! Think about your User Experience, it’s crucial. Your visitors are frustrated if they have to click twice on that Play button to launch a video!
- Because it doesn’t use any custom shortcode. WordPress already recognises YouTube videos when you paste their urls. SlimFast takes it from there. Why bother with shortcodes? Think long term! Shortcodes are painful if you decide to drop a plugin. If you’re unhappy with SlimFast, just deactivate it and all your YouTube videos will be back to their default iframes.
Let data speak for itself…
Testing conditions: 4 Youtube videos on a test page (blankslate theme), without SlimFast. Data is provided by GTMetrix.
Pretty bad, no? Look beyond the PageSpeed and YSlow scores, the page took 6 secondes to load, while Google recommends not to exceed 2 seconds!
The page is 6x slimmer and loads 3x faster! Now you see why we’ve called this plugin SlimFast!
A more visual comparison with/without SlimFast now
In the video below, we’re using the Google console and simulating a « good 3G » mobile connection. See the difference with your own eyes!
ps: yes, this video is served with SlimFast! As you see, it is transparent for the user. The video loads and plays fast.
Is it possible not to use SlimFast on a specific video?
Of course! Juste paste the iframe code provided by YouTube (for example <iframe width= »560″ height= »315″ src= »https://www.youtube.com/embed/neV3EPgvZ3g » frameborder= »0″ allow= »accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture » allowfullscreen></iframe>) and SlimFast will leave it intact. Do it if you feel like certain videos deserve features we’ve cut.
What is in the code?
- These will be loaded on your pages containing YouTube videos for an extra weight of 4KB only. Nothing will be loaded on pages that don’t host YouTube videos.