# Workflow: static site on Workers Static Assets

## 1. Build configuration

Set the build command and output directory in the Wrangler file (`[assets]` config): the framework's build output directory is what gets served. A wrong directory serves an empty site with a 200.

## 2. SPA fallback

Single-page apps need the fallback route: deep links (`/dashboard/settings`) must serve `index.html`, not 404. Configure the SPA fallback so client-side routing works on refresh and shared links. This is the blank-page-on-refresh bug, and it only appears after deploy.

## 3. Headers and redirects

Use `_headers` for security and cache headers (long immutable cache on fingerprinted assets, no-cache on HTML) and `_redirects` for vanity URLs and legacy paths. Prefer `_redirects` for static mappings; Single Redirects for dynamic ones.

## 4. Cache rules

Versioned/fingerprinted assets get long edge TTLs; HTML gets short or no cache. Pair with the invalidation workflow: new deploy, new asset URLs, purge HTML by tag.

## 5. Custom domain and SSL

Attach the custom domain, confirm Full (strict) SSL, and verify the apex and www both serve (redirect one to the other with a Single Redirect, specific rule first).

## Checklist

- Output directory correct, SPA fallback on, deep links tested after deploy.
- Headers file reviewed: no `no-store` on assets you want cached, no long max-age on HTML.
- curl the apex, www, and a deep link: all three must behave.