fix: remove dead /api/vitals beacon (66K wasted 404s/day)#787
Merged
Conversation
The custom vitals.ts script fires navigator.sendBeacon('/api/vitals') on
every page load, but no API route handler exists — every request 404s
via the Cloudflare Worker catch-all rule (~66K wasted requests/day).
@vercel/analytics (the <Analytics /> component already in BaseLayout)
collects the exact same Core Web Vitals data and sends it to
vitals.vercel-insights.com, making vitals.ts fully redundant.
Changes:
- Delete site/src/scripts/vitals.ts
- Remove vitals script import from BaseLayout.astro
- Remove web-vitals dependency from package.json
- Update design-integration-guide.md (protected components table,
checklist, and code example)
- Fix stale web-vitals comment in experiments.ts
Closes #786
Contributor
🧹 Lint & Format Results
Generated by Site CI workflow |
Contributor
|
🚀 Preview deployed: https://workflow-templates-3m1c3tpnd-comfyui.vercel.app |
Contributor
🔍 SEO Audit Results
📊 SEO Audit DetailsCould not parse SEO output 🔗 Link Check Detailsbroken internal links out of checked Generated by Site CI workflow |
dante01yoon
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The custom
vitals.tsscript firesnavigator.sendBeacon('/api/vitals')on every page load (6 Web Vitals metrics per visit), but no API route handler exists. Every beacon request hits the Cloudflare Worker catch-all rule, gets routed to Framer, and 404s — generating ~66K wasted requests/day.@vercel/analytics(the<Analytics />component already inBaseLayout.astro) collects the exact same Core Web Vitals data and sends it tovitals.vercel-insights.com, makingvitals.tsfully redundant.Changes
site/src/scripts/vitals.tsBaseLayout.astroweb-vitalsdependency frompackage.json+ regenerate lockfiledesign-integration-guide.md— remove vitals.ts from protected components table, implementation checklist, and code exampleweb-vitalscomment inexperiments.tsVerification
pnpm run build— passespnpm test— all 80 tests passvitals.tsorweb-vitalsin sourceCloses #786