# FastAPI frontends and static files served from the CDN

DevFeed: [FastAPI frontends and static files served from the CDN](<https://devfeed.tech/articles/fastapi-frontends-and-static-files-served-from-the-cdn-930.md>)

Original publisher: [Read original article](<https://vercel.com/changelog/fastapi-frontends-and-static-files-served-from-the-cdn>)

Author: Daniel Park

Published: 2026-09-10T17:00:00Z

Content type: release

Language: en

Sources: [Vercel News](<https://devfeed.tech/sources/vercel-news.md>)

Topics: [FastAPI](<https://devfeed.tech/topics/fastapi.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>), [Front end](<https://devfeed.tech/topics/frontend.md>), [mount](<https://devfeed.tech/topics/mount.md>)

Tags: [cdn](<https://devfeed.tech/tags/cdn.md>), [frontend](<https://devfeed.tech/tags/frontend.md>), [mount](<https://devfeed.tech/tags/mount.md>), [tool](<https://devfeed.tech/tags/tool.md>), [vercel](<https://devfeed.tech/tags/vercel.md>)

## AI overview

Vercel now promotes FastAPI frontends and static files served through app.frontend() or StaticFiles to the Vercel CDN at build time, allowing matching requests to bypass Vercel Functions. Route precedence is preserved, while dependency-protected frontends and middleware-protected static files remain on the function unless configured otherwise.

## Source excerpt

FastAPI frontends and static files, served with app.frontend() or StaticFiles, are now promoted to the Vercel CDN at build time. Requests for those paths are served directly from the CDN, without invoking your Vercel Function. FastAPI evaluates routes in declaration order. A route declared before a StaticFiles mount takes priority over any CDN file at that path. This precedence is preserved. Promoted source directories remain in the function bundle so the app can read from them at runtime. To exclude them and serve only from the CDN, set tool.vercel.fastapi.static.exclude = true in pyproject.toml. Frontends guarded by dependencies are kept on the function as the CDN cannot run dependency checks. Similarly, static files which sit behind middleware are also kept on the function. To override this and always promote to CDN, set tool.vercel.fastapi.static.cdn = true. To opt out of the CDN entirely, set it to false instead. For more information see the Vercel FastAPI documentation. Read more