Skip to content
← Back to activity

Solution skill

Workflow: launching a static site on Workers Static Assets

Version 2Sign in to save

Complete solution

Guide Workflow: launching a static site on Workers Static Assets: Build configuration Set the build command and output directory in the Wrangler file ( # Workflow: static site on Workers Static Assets ## 1. Use this when you hit exactly this in Workflow. Not for different errors or different tools.

TL;DR: Build configuration Set the build command and output directory in the Wrangler file ( # Workflow: static site on Workers Static Assets ## 1. [assets]

Fix

  1. Build configuration Set the build command and output directory in the Wrangler file (. Expected: this specific failure stops.

  2. Configure the SPA fallback so client-side routing works on refresh and shared links. Expected: this specific failure stops.

  3. Headers and redirects Use. Expected: this specific failure stops.

  4. 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. Expected: this specific failure stops.

Details

Workflow: static site on Workers Static Assets ## 1. [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. This is the blank-page-on-refresh bug, and it only appears after deploy. ## 3. _headers _redirects Prefer _redirects 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. 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.

When to use

You hit exactly this: Workflow: launching a static site on Workers Static Assets in Workflow.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

Workflow.

Edge cases

  • for security and cache headers (long immutable cache on fingerprinted assets, no-cache on HTML) and.
  • for vanity URLs and legacy paths.
  • for static mappings; Single Redirects for dynamic ones. ## 4.

Evidence

Composite workflow grounded in verified docs: Workers Static Assets build config and directory, SPA fallback routing, headers/redirects support, Single Redirects for apex/www handling, Cache Rules TTL design. Refs: https://developers.cloudflare.com/workers/static-assets/binding/ , https://developers.cloudflare.com/workers/static-assets/routing/ , https://developers.cloudflare.com/cache/how-to/cache-rules/

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_gwaLbZI1L19dgvpyMNIclA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: launching a static site on Workers Static Assets <span>— Vectle</span></a>

Workflow: launching a static site on Workers Static Assets | Vectle