Hey, Webflow developers,
Today I want to share some tips to maximize your Webflow site performance and impress your users with lightning page load and blazing interactions.
When you start working on the new site, the site speed is rarely on top of your mind. However, when the design and content are finalized, the question of site performance becomes acute.
How to measure speed and performance
Google uses the tool Lighthouse to measure and report on the PSI site the following metrics of the website:
- First Contentful Paint (FCP).
- Speed Index (SI).
- Largest Contentful Paint (LCP).
- Time to Interactive (TTI).
- ââTotal Blocking Time (TBT).
- Cumulative Layout Shift (CLS).
Each metric has a âweightâ from 10% (FCP) to 30% (TBT). You can play with the performance calculator here.
Webflow default speed optimization features
Not surprisingly, Webflow has many optimization features working out of the box. They deliver your site and assets through the Content Delivery Network (CDN). You can enable HTML/CSS/JS code minification (donât forget to do it).
Webflow uses Responsive images to automatically resize your images for different screen sizes (through added âsrcsetâ). It doesnât mean you can stop paying attention to the image sizes, but itâs very useful and handy.
Webflow generates and stores static pages for your CMS collection items, lazy loads images by default, etc.
However, youâd need to do much more than that to create a snappy website. Letâs get to them.
Third-party scripts optimization
Third-party scripts are probably the number 1 cause of bad site performance. And it will be most likely the number one recommendation in your Lighthouse / PSI report.
Unfortunately, no modern production website can get away without any scripts. Youâd need at least 2-3 analytics and likely at least one ad library on your site. Hereâs what you should do.
-
Ensure that the script is added only to the page where itâs used. Leave in the global footer page only scripts that are used on every single page (like analytics, fonts, etc.). And make a policy to test any new script through performance analysis before adding it.
-
Move scripts from ââ to ââ before the closing ââ tag.
-
When adding the ââ tag, you have an option to use âdeferâ or âasyncâ attributes.
-
If the piece of code is small, just copy-paste it on your site.
-
If the script is not critical but still useful to have â delay the loading of this script for a few seconds with the âsetTimeoutâ function.
-
Load scripts conditionally. For example, if you donât run remarketing campaigns, your ad scripts are not always needed.
-
Use âpreconnectâ or âdns-prefetchâ for required origins
Fonts
Fonts are an important part of almost every website. Unfortunately, as of 2022, the default implementation in Webflow is done very poorly. Below is what you should do.
- Minimize the number of fonts
- Upload fonts manually with âswapâ
- Preload fonts with code
â
Images
Images are often among the heaviest assets on the page. Getting them right is crucial for a snappy website. Webflow helps with the Responsive images feature, but itâs not enough.
- Compress all images and use WebP.
- Ensure all your images below the first screen are set to lazy load.
- Do not use images as âbackgroundâ
- Use SVGs where applicable
- Embed small SVGs directly
Video
Webflow doesnât make good friends with videos. Their automatic video transcoding can dignficantly decrease video quality (and thereâs no option to disable it).
Also, many users complain that the resulting âoptimizedâ and transcoded video file by Webflow can have an even larger size than the original (up to twice the size).
This is why I avoid using native Video elements in Webflow and prefer the Youtube element or embed Youtube/Vimeo iframe directly where needed.
Site organization
There are many recommendations for your site organization that will help make your website smaller in size and more responsive to your users.
- Make sure to regularly press âClean upâ in the âStyle Managerâ.
- Set styles on the root level
- Disable features you donât use
- Preload critical links
I give even more tips with examples and screenshots in my article.
If you prefer video content, hereâs Youtube tutorial.