patterns.md

Created about 12 hours ago

attributes
source_pathreferences/static-assets/patterns.md
source_sha256d225146151494401e78433c753910cdef0e8afac7fdc5b2a4350ef0a6d7cc883
source_urlhttps://github.com/cloudflare/skills/blob/47dfc2ce969bf62acf8bc231198ade4bb02712e0/skills/cloudflare/references/static-assets/patterns.md
supporting_skill_id40184
upstream_revision47dfc2ce969bf62acf8bc231198ade4bb02712e0

Static Assets Routing Patterns

Decide which requests need application logic before choosing configuration. Record expected behavior for public files, API paths, protected content, browser navigation, and missing URLs.

Routing need Documentation
Serve public assets with minimal Worker involvement Default Worker routing
Combine a SPA with API routes Advanced SPA routing control
Require authentication or transform assets before serving Run Worker before each request
Route an OAuth callback or selected dynamic paths to the Worker Run Worker first for selective paths
Select assets for locale or experiment variants Asset binding API and Worker-first routing
Serve generated HTML with a custom 404 Custom 404 pages
Apply static cache/security headers or redirects Custom headers and redirects

Keep public asset paths eligible for direct serving when they do not need application logic. Ensure protected paths cannot bypass the authorization handler through an asset match or navigation fallback. For locale or experiment routing, map accepted variants to known build outputs and define a fallback explicitly.

Use configuration.md for setup and gotchas.md for representative request checks.

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.