WordPress Plugins
Free Tools
Claude Skills
Resources
Pricing Agencies Support My Account Cart
Support / ForgeCache / Google Fonts

Self-Hosting Google Fonts with ForgeCache

ForgeCache can serve the Google Fonts your theme and plugins use from your own site instead of from Google, show text straight away while fonts load, and preload the one or two font files the top of your pages needs. This page explains the three font settings, what happens the first time fonts are downloaded, and how to check it is working.

Where the settings are

Go to ForgeCache → Settings → Optimization. The three font settings sit together:

SettingWhat it doesDefault
Google Fonts OptimizationDownloads the Google Fonts your pages use and serves them from your site.On
Font Display SwapShows text at once in a fallback font while Google Fonts load.Off
Preload FontsTells browsers to start downloading the font files you list straight away.Empty

Saving a change to any of them clears the page cache, so cached pages pick up the new font markup at once.

Self-hosting Google Fonts

With Google Fonts Optimization on, ForgeCache finds the Google Fonts stylesheet links in your pages, downloads each stylesheet and its font files to your site, and points the links at the local copies. Visitors then load the fonts from your site, without a separate connection to Google.

The first visits after you turn it on

Fonts are downloaded in the background, a few at a time. On most hosts the download starts after the page has been sent to the visitor, so nobody waits for it; on servers that can’t finish a page early, a page view spends at most about 3 seconds on downloads and a scheduled task carries on with the rest. Until a stylesheet and all its font files are on your site, pages keep loading that font from Google as before. Large font families with many weights and styles can take several page views, or a few minutes of background work, to finish.

So the first visits after you turn it on may still load fonts from Google. That’s expected. Once a stylesheet is complete, ForgeCache clears the page cache, and pages are rebuilt to load the font from your site.

If one font file won’t download

A font file that fails to download three times stays at Google, and the rest of the stylesheet is served from your site. ForgeCache tries that file again about once a day. Font files larger than 4 MB are not downloaded.

Font Display Swap

Without it, some browsers keep text invisible until the web font has downloaded. With Font Display Swap on, ForgeCache sets font-display: swap on Google Fonts, so visitors can read straight away in a fallback font and the web font takes over when it is ready.

Preload Fonts

A preload tells the browser to fetch a font file at once, before it has read your stylesheets. Use it for the font of your headline or main text, the one visitors see first.

/wp-content/themes/your-theme/fonts/heading.woff2
https://cdn.example.com/wp-content/uploads/fonts/body.woff2
Preload one or two files, not your whole font family

Every preloaded file competes with your images and scripts for the first moments of loading. Preloading many fonts makes a page slower, not faster. List only what the top of your pages needs.

Check it is working

Open a page logged out

Use a private window, so you see the page visitors get.

Look at the font requests

Open your browser’s developer tools, go to the Network tab, filter by Font and reload. Self-hosted fonts load from your own domain (or your CDN); fonts still downloading load from fonts.gstatic.com.

Still loading from Google after a while?

Visit a few more pages and check again a few minutes later. If fonts still come from Google, make sure WordPress scheduled tasks run on your site and that your server can reach Google Fonts.

Related