3 minute read Big improvements don't have to be hard nor take a long time to implement. It took, for example, only 17 lines of code to decrease the time to display text on Shopify.com by 50%. That saved visitors 1.2 seconds: each second matters given that 40% of users expect a website to load within two seconds and those same users will abandon a site if it takes longer than three.
Overview
The article discusses how a mere 17 lines of code significantly improved the loading time of Shopify.com by 50%, resulting in a 1.2-second reduction in the time to display text. It highlights the use of the preload feature to optimize font loading, enhancing user experience by eliminating the Flash of Invisible Text (FOIT).
What You'll Learn
How to implement the preload feature to optimize resource loading
Why reducing loading time is critical for user retention
When to use preload for fonts and other resources
Key Questions Answered
How did 17 lines of code improve Shopify.com loading time?
What is the Flash of Invisible Text (FOIT) and how is it avoided?
Which browsers support the preload feature?
Key Statistics & Figures
Technologies & Tools
Key Actionable Insights
1Implementing the preload feature can drastically improve website loading times.By preloading fonts and other resources, developers can enhance user experience, particularly on sites where loading speed is critical for user retention.
2Reducing dependencies on third-party libraries can simplify implementation.Shopify chose not to use options like Google Font Loader or FontFaceObserver, which require additional dependencies. This decision streamlined their code and reduced complexity.
3Monitoring performance using tools like SpeedCurve can provide immediate feedback on changes.Using performance testing tools helps identify the impact of optimizations, allowing teams to make informed decisions based on real data.