Font Optimization
Self-host Google Fonts, enable font-display swap, and preload critical fonts.
Last updated Feb 6, 2026
Why Font Optimization Matters
Web fonts are one of the most common causes of slow rendering. Loading Google Fonts requires DNS lookups, TCP connections, and TLS handshakes to external servers before a single character can render. BoostPro eliminates these bottlenecks.
Self-Host Google Fonts
Instead of loading fonts from Google's servers, BoostPro downloads the font files and CSS to your own server. This eliminates external network requests and improves GDPR compliance by keeping font requests on your domain.
- Default: Off
- What it does: Intercepts
fonts.googleapis.comCSS URLs, downloads all font files (woff2, woff, ttf), and rewrites URLs to serve from/uploads/boost-fonts/ - Cache duration: 7 days, with automatic background refresh
- Size limit: 100MB total cache, with automatic cleanup of files older than 30 days
How the Cache Works
BoostPro uses a "stale-while-revalidate" caching strategy:
- First request: Downloads and caches fonts (may take a moment)
- Subsequent requests: Serves from local cache instantly
- After 7 days: Continues serving cached fonts while refreshing in the background
- Weekly cleanup: Removes files older than 30 days
Tip
After enabling self-hosting, clear your page cache so the new local font URLs take effect immediately.
Font Display Swap
By default, some browsers hide text until the web font loads (called Flash of Invisible Text, or FOIT). Font display swap tells the browser to show a fallback font immediately and swap in the web font once it's ready.
- Default: On
- What it does: Appends
?display=swapto Google Fonts URLs and addsfont-display: swapto @font-face declarations - Impact: Text is visible immediately, improving perceived performance and LCP scores
Users may briefly see a fallback font before the custom font loads. This is called Flash of Unstyled Text (FOUT) and is generally preferred over invisible text.
Preload Key Fonts
Font preloading tells the browser to start downloading critical font files as early as possible, before the CSS that references them is even parsed.
- Default: Off
- Requires: Self-Host Google Fonts must be enabled
- What it does: Adds
<link rel="preload" as="font" type="font/woff2" crossorigin>hints in the<head> - Limit: Preloads up to 6 woff2 font files
Important
Only preload fonts that are actually used on most pages. Preloading fonts that aren't used wastes bandwidth and can hurt performance. This feature automatically selects from your cached font files.
GDPR Compliance
Loading Google Fonts from Google's servers sends your visitors' IP addresses to Google, which can be a GDPR concern (notably after the Austrian DPA ruling in January 2022). Self-hosting fonts addresses this concern since all requests stay on your domain.
Recommended Setup
- Enable Font Display Swap first (safe, immediate improvement)
- Enable Self-Host Google Fonts if your theme or plugins use Google Fonts
- Clear your page cache after enabling self-hosting
- Optionally enable Preload Key Fonts if you want maximum font loading speed
- Run a PageSpeed test to verify the improvement