Vercel FastAPI Integration Enables CDN-Based Static File and Frontend Serving
Vercel now promotes FastAPI frontends and static files to the CDN at build time, bypassing Vercel Functions for these requests. Users can control this behavior via the tool.vercel.fastapi.static configuration in pyproject.toml.
Verified State Diff
Impact & Verification Analysis
Developers deploying FastAPI applications on the Vercel platform.
This significantly reduces cold starts and function execution costs by offloading static asset delivery to the global CDN network while providing granular control over file exclusion and override logic.
Full Fact Overview
Vercel has updated its FastAPI integration to automatically promote static files and frontends served via app.frontend() or StaticFiles to the Vercel CDN during the build process. This change reduces function execution overhead by serving these assets directly from the edge. The system maintains route declaration priority, ensuring that routes defined before a StaticFiles mount take precedence. Developers can now manage this behavior using specific flags in pyproject.toml: tool.vercel.fastapi.static.exclude to remove files from the function bundle, tool.vercel.fastapi.static.cdn to force CDN promotion for files behind middleware or dependencies, and setting the same key to false to disable CDN serving entirely.