Firebase Hosting Headers Config: Cache, Security, CORS
The headers block in firebase.json controls cache TTL, security policy, and CORS. Here is the minimum config that ships fast and safe — and the patterns that cost you.
Articles tagged with #Firebase
The headers block in firebase.json controls cache TTL, security policy, and CORS. Here is the minimum config that ships fast and safe — and the patterns that cost you.
Firestore writes / Functions calls / Hosting bandwidth — each has a hard line on free tier.
`FAILED_PRECONDITION: The query requires an index` — multi-field where + orderBy demands a composite index.
Same domain works fine when bound to Vercel, fails when you try Firebase Hosting. Why Firebase has stricter requirements and how to fix.
Firebase config audit prompts — Firestore / Realtime DB / Storage rules, indexes, Cloud Functions, Auth, App Check, hosting.
Step-by-step on deploying a static Astro site to Firebase Hosting, with the configuration that avoids the common pitfalls in 2026.
A no-nonsense 2026 walkthrough for shipping a static site (Astro, Vite, plain HTML) to Firebase Hosting in about 10 minutes — including SSL, custom domain, and cache headers.
Deployed but visitors see the old page? Use this firebase.json cache-header config, curl diagnostic, and rollback to flush stale content in seconds.
Add a custom domain to Firebase Hosting with the exact DNS records, dig commands for verification, and the common failures explained.
The Firebase Spark free tier in 2026 gives 10 GB storage + 360 MB/day egress. Use this page-weight math, budget config, and asset checklist to know if you fit.
A 10-item pre-launch checklist for sites going live on Firebase Hosting in 2026 — covering domain, SSL, cache, redirects, sitemap, Search Console, and rollback rehearsal.
Rewrites in Firebase Hosting let you map URLs to functions, Cloud Run, or single-page apps. Here is when each pattern is the right tool — and when rewrites cause more problems than they solve.
Pages that worked locally return 404 on Firebase Hosting. Use this diagnostic checklist with firebase.json snippets and curl commands to pinpoint the cause.
Firebase Hosting is Google's static + edge CDN service tied to Firebase. Here is when it fits, with the firebase.json baseline and deploy commands.
Firebase deploy fails with permission errors — IAM, login, or project mismatch.
Calling a function returns "not found." Likely region, name, or deploy.
Hosting deploy fails — CLI version, quota, or firebase.json config.
After deploying to Firebase Hosting, the homepage works but /about and other subpages return 404? Your firebase.json rewrites are misconfigured. Fixes for SPA, SSG, static multipage, Astro, and Next.js.
You configured rewrites for SPA / functions but they don't trigger.
Both have generous free tiers and great DX. Here's how Firebase Hosting and Vercel differ on serverless, ecosystem, deployment, SEO, and pricing in 2026.