Skip to content

perf(worker): return unknown 404s at gateway#660

Merged
tiankaima merged 3 commits into
mainfrom
fix/direct-public-not-found
Jul 26, 2026
Merged

perf(worker): return unknown 404s at gateway#660
tiankaima merged 3 commits into
mainfrom
fix/direct-public-not-found

Conversation

@tiankaima

@tiankaima tiankaima commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

  • return deterministic unknown-root 404 documents directly from the outer Worker gateway
  • preserve locale negotiation, CSP, privacy/cache directives, content signal, security headers, and unique request IDs
  • preserve every known top-level SvelteKit route, including legacy /api-docs, /error, /e2e, robots, sitemap, and llms.txt
  • bypass SvelteKit SSR, auth/database work, hydration payloads, and the named cache only for confirmed unknown roots

Why

Post-merge production verification of #658 and #659 proved that the cache-enabled named entrypoint cached unknown 404 responses but did not replace the SvelteKit body with the lightweight document. A static 808/814-byte localized response does not benefit from an inner cache and is faster and more reliable when generated directly at the gateway.

Verification

  • Biome and diff checks passed
  • focused public SSR unit suite: 28 passed
  • production build passed
  • local Wrangler unknown GET: 404, 808/814 bytes, script-free, localized, private/no-store
  • local Wrangler unknown HEAD: 404 with no body and the same security/cache headers
  • local Wrangler /api-docs: 308 to /api/docs/tag/catalog-section
  • local Wrangler /error and /e2e/oauth/callback: 200 with app hydration shell
  • local Wrangler /robots.txt: 200 text/plain
  • no API endpoint added

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
life-ustc 44ec7aa Jul 26 2026, 06:54 PM

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

@tiankaima
tiankaima merged commit 136d540 into main Jul 26, 2026
15 checks passed
@tiankaima
tiankaima deleted the fix/direct-public-not-found branch July 26, 2026 19:04
github-actions Bot pushed a commit that referenced this pull request Jul 26, 2026
## [1.77.19](v1.77.18...v1.77.19) (2026-07-26)

### Performance Improvements

* **worker:** return unknown 404s at gateway ([#660](#660)) ([136d540](136d540))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.77.19 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant