Robert and Chris jump on to talk about own own little CDN project. Maybe that’s not the right term, but we struggled with naming it. Truth be told, it’s the /public/
folder in our monorepo, where the purpose is getting files to the world wide internet at URLs that anyone can access. Our favicon is a good example, where many of our sites need access to that, but we only want it once in our repo (but we have actually lots of use-cases.)
There are several complications along the way. One is that we need to fingerprint these files so we can cache-bust them when needed. We also need to be able to import the URLs in other parts of the repo, so we need manifest files that contain those URLs in multiple formats. Plus many of the files have their own build process, they aren’t just entirely static files. In the end, building our own thing was probably the right move.
The files go to Cloudflare R2, which, I suppose, is the CDN part.
Time Jumps
- 00:40 Introducing Robert
- 01:02 Our public CDN
- 04:25 How we might make the first version of this
- 09:58 How we link to fonts on the web
- 14:01 What is the correct way to implement this?
- 17:19 Accounting for different dev environments
- 22:29 How do we run deployment?
- 31:06 Why did we make our own build tool?
- 40:27 Taking in environment variables