User-deployed apps using the data-app-html-python template serve all static assets (CSS, JS, images, fonts) through the FastAPI/Uvicorn process running on Modal. Every request -- including repeat visits for the same unchanged styles.css -- travels from browser to Cloudflare edge to Modal container to Python to filesystem and back. This creates:
- Unnecessary latency: Static files go through the full Python middleware stack (~10x slower than native file serving)
- Cold start exposure: After 15 min idle, Modal scales to zero. The next visitor waits 1-3+ seconds for container boot, even for a CSS file
- Wasted compute cost: Modal bills per-second for container time. Serving static files through Python wastes expensive compute on file I/O
- Poor repeat-visit performance: No browser-side
Cache-Controlheaders means browsers revalidate every request