App to Cache Google Fonts on WordPress for GDPR
I accidentally found about Google Fonts’ privacy issues, while I was troubleshooting what happened to Simple Analytics —I accidentally killed the hook along with the legacy GA codes, a story for another time. The problem at hand was simple. Google Fonts is a freely available service, but exchanging data with Google had legal repercussion in Europe. Apparently the regulation-friendly way to host Google Fonts was to cache them.
And this is where it could get out of hands relatively quickly; caching plugins for WordPress have its own requirements for servers, and not all of them work greatly with Google Fonts. In fact, while I was researching on cache related subjects awhile back, one of the recommendations I found was that Google CDN won’t be the bottleneck —it is, now.
OMGF is a plugin that helps with caching Google Fonts. There are features paywalled behind the “Pro” version, but for what it advertises to do on free tier, I wouldn’t call it a freemium software.
One of the features reserved for Pro version is supporting @import
on css. That’s how I had done it previously. Apparently it’s a rule of the thumb in industry to use <link>
to serve cached fonts. I had styled my css file to have designated @import
header to speak of, so it wasn’t hard for me to make the jump. I’ll do a write up on the subject in the future. But for what it’s worth, I’ve seen web developers making strong case for @import
, especially to keep the stylistic changes more tenable. Ultimately it’s a matter of preferences, but this plugin does have a price tier.