ZERO-COST STACK ACTIVE
Claim Subdomain
TECHNICAL ARCHITECTURE MONOGRAPH · REV 3.4

Zero-VPS Multi-Tenant Wildcard Subdomain Publishing on Serverless Edge Infrastructure

How MyfaPost Creator OS achieves sub-200ms global HTML5 delivery across unlimited *.myfa.page subdomains at $0.00 marginal infrastructure cost.

1. Host-Header Inspection & Internal Edge Rewriting

Instead of provisioning virtual private servers or reloading Nginx virtual hosts when a user claims a new subdomain, MyfaPost points a single wildcard DNS record (*.myfa.page CNAME cname.vercel-dns.com) to Vercel's Anycast Edge network. On every incoming request, src/middleware.js parses the Host header and executes an internal URL rewrite to /sites/[subdomain]/[slug].

Incoming Request: https://hacker.myfa.page/top-hack-now
Edge Middleware Rewrite: /sites/hacker/top-hack-now
Firestore Composite Key: posts/hacker__top-hack-now

2. Deterministic O(1) Document Schema on Firebase Spark

Firebase Cloud Storage requires upgrading to a paid Blaze billing plan. To keep the platform 100% free forever on the Firebase Spark tier, MyfaPost stores the complete compiled index.html payload (validated up to 900 KB) directly inside Cloud Firestore collection posts/{subdomain}__{slug}. Because the document ID is deterministic, edge route handlers retrieve any article in a single O(1) primary-key lookup without secondary index scans.

3. Edge Cache Amplification Mathematics (`stale-while-revalidate`)

Each tenant route handler emits Cache-Control: public, s-maxage=60, stale-while-revalidate=300. When a dispatch experiences a viral traffic spike, Vercel's edge PoPs serve cached HTML responses directly from memory for 60 seconds, collapsing tens of thousands of reader requests into a single background Firestore read per minute.