Page cache clearing
When the fonts on your site change, Nahnu Fonts clears the page cache of 9 popular cache plugins, so visitors see the change right away instead of old cached pages.
When the cache is cleared#
The cache is cleared after the stylesheet is rebuilt and its content actually changed, for example when you:
- add, update, re-download or delete a font
- switch a font on or off
- change a font’s fallback, “Apply to” selectors or preloads
- change a setting that affects the CSS, such as Font display or CSS variables
- connect or disconnect Adobe Fonts
- import fonts
A rebuild that produces the same CSS doesn’t clear anything, so your cache isn’t emptied for nothing.
Supported cache plugins#
Each plugin is cleared with the method its own documentation gives for clearing everything.
| Cache plugin | What is cleared |
|---|---|
| WP Rocket | The whole domain’s cache, then minified CSS and JS |
| LiteSpeed Cache | Everything (purge all) |
| W3 Total Cache | All caches |
| WP Super Cache | The whole cache |
| WP Fastest Cache | All cache, including minified files |
| SiteGround Speed Optimizer | The dynamic and file cache |
| Breeze | All cache |
| WP-Optimize | The page cache |
| xSpeed Cache | The same as its Purge All button |
Settings → Loading → Clear page cache when fonts change lists the plugins detected on your site, or says “No supported cache plugin detected.”
xSpeed Cache and query strings#
xSpeed Cache’s “Remove Query Strings” option would strip the version from our stylesheet’s address, so browsers could keep an old copy. Nahnu Fonts tells xSpeed Cache to keep the version on nahnu-fonts.css only.
Turn it off#
Switch off Clear page cache when fonts change in Settings → Loading. You then need to clear your cache yourself after changing fonts.
Other caches#
These aren’t cleared automatically. Clear them by hand after changing fonts:
- Your host’s server cache (many hosts have a “Purge cache” button in their dashboard or the WordPress admin bar).
- A CDN such as Cloudflare. The stylesheet’s address changes with each version, so a CDN mostly needs clearing for cached HTML pages.
- Cache plugins not in the list above.
Developers can clear other caches automatically with the nahnu_fonts_after_purge_cache action. See Hooks in Developer.