Background

I run a handful of small static sites as a side project. All but one work the same way: a build script emits HTML, and firebase deploy --only hosting ships it.

One site is different. Its articles live in Firestore, and the HTML is assembled by a Cloud Function that pushes pages through the Firebase Hosting REST API. This post explains why I made that exception and what it cost me.

Some terms up front, since I will use them throughout:

Firebase Hosting — a CDN (Content Delivery Network: copies of your files are kept on servers around the world so visitors are served from a nearby one). Normally you upload a local directory to it.