Font Optimization
Self-host Google Fonts locally, enable font-display swap, and preload critical woff2 files.
Last updated Feb 21, 2026
Overview
Google Fonts are the most widely used web fonts, but loading them from Google's servers adds DNS lookups, TCP connections, and TLS handshakes to every page load. BoostPro optimizes font delivery for both speed and GDPR compliance.
These settings are located on the BoostPro → Optimization tab, under the Fonts section.
Self-host Google Fonts
AdvancedWhen enabled, BoostPro downloads Google Fonts to your server and rewrites all references to serve them locally. This eliminates external requests to fonts.googleapis.com and fonts.gstatic.com.
Font files are stored in /wp-content/uploads/boost-fonts/ using a consistent naming scheme:
- Stylesheets:
gf-{md5}.css - Font files:
{md5}.woff2
Cache management
The local font cache refreshes automatically to stay current:
- Cache TTL: 7 days (604,800 seconds)
- Auto-refresh: via
boost_refresh_font_cachecron event - Storage limit: 100MB maximum
- Cleanup: unused files older than 30 days are automatically removed
GDPR compliance
Loading fonts from Google's servers sends visitor IP addresses to Google, which may violate GDPR requirements in some jurisdictions. Self-hosting eliminates all requests to Google's font servers, keeping visitor data on your own infrastructure.
Tip
Self-hosting Google Fonts eliminates a DNS lookup, TCP connection, and TLS handshake to fonts.googleapis.com. It's also required for GDPR compliance in some jurisdictions.
Font display swap
When a browser loads a web font, it can either show invisible text until the font arrives (Flash of Invisible Text, or FOIT) or show a fallback system font and swap in the custom font when ready (Flash of Unstyled Text, or FOUT).
BoostPro adds font-display: swap to both Google Fonts URLs and inline @font-face declarations. This ensures visitors see text immediately using a system font, with the custom font swapping in once loaded.
A brief FOUT is expected and preferred over invisible text. Visitors can start reading content immediately instead of staring at blank space while fonts download.
Preload key fonts
AdvancedFont preloading tells the browser to start downloading critical font files as early as possible, before it discovers them through CSS parsing. BoostPro automatically preloads up to 6 woff2 files from the local font cache by adding hints to the <head>:
<link rel="preload" as="font" type="font/woff2" crossorigin href="/wp-content/uploads/boost-fonts/abc123.woff2">This setting only works when self-hosting is enabled, since it needs local font files to reference in preload hints.
Important
Preloading too many fonts can hurt performance by competing with other critical resources. BoostPro limits preloading to 6 files. If your site uses many font weights and styles, only the most critical are preloaded.
Recommended setup
For the safest rollout, enable these features in order:
- Font display swap — lowest risk, immediate improvement to perceived load time
- Self-host Google Fonts — eliminates external requests, improves GDPR compliance
- Preload key fonts — further reduces font load time for self-hosted files