Cloudflare cache frustration
Senseless errors annoying lots of people
I spent most of today debugging a senseless error.
This morning’s flight of BunTool emails included a suggestion to include compatibility for Times New Roman and Arial fonts. That’s a great idea because some tribunals specify font typesIn fact it’s a minor access to justice issue that courts require people to use proprietary fonts, but probably not a deliberate one. Most people seem to think of TNR and Arial as being generic and free, even if that’s wrong. Fair enough given their prevalence and the hyper-niche nuance of font IP law. and the plumbing for it was mostly there in the backend.
The trouble is that both those fonts are proprietary and BunTool is FOSS. So I found two excellent alternatives - respectively, CharisSIL and Liberation Sans.Why not Liberation Serif too? Only because I liked Charis. All the Liberation fonts are great! So I loaded those in and connected up the plumbing, spun up the test cases and all worked well.
Deploying broke everything. Cloudflare was serving some fonts but not others, even fonts of the same size and in the same directories as working fonts.
Why? After two hours I’m pretty sure it was a Cloudflare caching error. Branching and deploying to a fresh preview instance confirmed this was probably the error, since it didn’t have the same problems. But annoyingly even purging CF’s cache didn’t fix it.
In the end I did:
- Roll back to working instance
- Copy font files only (and no code) from my
devbranch tomain - redeploy
- then merge
devintomain, once fonts were already deployed.
Somehow, that stage of copying just the fonts dir into CF’s deployment first, and then merging seemed to have helped. Or perhaps it just caught up over the two hours that I was trying to diagnose the problem? I’ll never know.