To minimize layout shifts caused by web fonts and improve loading performance, preloading fonts and managing font loading strategies effectively are key.
Best practices for preloading fonts:
- Preload only critical fonts needed for the initial above-the-fold content to avoid unnecessary network competition and delays. For example, preload the main body or heading font but not every style or weight like italics or bold.
- Preload only modern font formats such as
.woff2
to reduce file size and improve load speed, avoiding older formats like.woff
or.ttf
. - Use a proper
<link rel="preload" as="font" crossorigin="anonymous">
tag in the HTML head to fetch fonts early, making font requests parallel to CSS and reducing render-blocking.
Managing font-display to prevent layout shifts:
- Use the CSS
font-display
property in@font-face
declarations to control how fonts load and fallback fonts behave. Thefont-display: optional
value is effective in preventing layout shifts by allowing the browser to use a fallback font if the web font is not loaded quickly, avoiding invisible or shifting text. - Other
font-display
options include:block
: hides text up to 3 seconds waiting for the font (can cause layout shifts).swap
: shows fallback immediately and swaps to web font when loaded.fallback
: hides text briefly then swaps if font loads soon.optional
: hides text very briefly and only uses web font if available immediately, never swapping later.
Additional recommendations:
- Combine font preloading with
font-display
to balance user experience and performance. - Avoid preloading too many fonts or multiple styles to prevent bandwidth bottlenecks and delays.
- Ensure font URLs used in preload tags exactly match those suggested by performance tools like PageSpeed Insights and that fonts are hosted on your domain or CDN to avoid conflicts.
By carefully preloading only essential fonts and using font-display: optional
or similar strategies, you can significantly reduce layout shifts caused by web fonts and improve your site's Core Web Vitals and user experience.
PH Ranking offers the highest quality website traffic services in Philippines. We provide a variety of traffic services for our clients, including website traffic, desktop traffic, mobile traffic, Google traffic, search traffic, eCommerce traffic, YouTube traffic, and TikTok traffic. Our website boasts a 100% customer satisfaction rate, so you can confidently purchase large amounts of SEO traffic online. For just 720 PHP per month, you can immediately increase website traffic, improve SEO performance, and boost sales!
Having trouble choosing a traffic package? Contact us, and our staff will assist you.
Free consultation