Skip to content

fix: remove dead /api/vitals beacon (66K wasted 404s/day)#787

Merged
christian-byrne merged 1 commit into
mainfrom
fix/remove-dead-vitals-beacon
Apr 18, 2026
Merged

fix: remove dead /api/vitals beacon (66K wasted 404s/day)#787
christian-byrne merged 1 commit into
mainfrom
fix/remove-dead-vitals-beacon

Conversation

@christian-byrne

Copy link
Copy Markdown
Contributor

Summary

The custom vitals.ts script fires navigator.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 in BaseLayout.astro) 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 + regenerate lockfile
  • Update design-integration-guide.md — remove vitals.ts from protected components table, implementation checklist, and code example
  • Fix stale web-vitals comment in experiments.ts

Verification

  • pnpm run build — passes
  • pnpm test — all 80 tests pass
  • ✅ No remaining imports or usages of vitals.ts or web-vitals in source

Closes #786

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
@christian-byrne christian-byrne added the bug Something isn't working label Apr 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧹 Lint & Format Results

Check Status
ESLint ✅ success
Prettier ✅ success

Generated by Site CI workflow

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview deployed: https://workflow-templates-3m1c3tpnd-comfyui.vercel.app

@github-actions

Copy link
Copy Markdown
Contributor

🔍 SEO Audit Results

Check Status
Sitemap Validation ✅ passed
SEO Audit ✅ passed
Internal Links ❓ skipped
📊 SEO Audit Details

Could not parse SEO output

🔗 Link Check Details

broken internal links out of checked


Generated by Site CI workflow

@christian-byrne christian-byrne merged commit e35d491 into main Apr 18, 2026
14 checks passed
@christian-byrne christian-byrne deleted the fix/remove-dead-vitals-beacon branch April 18, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dead /api/vitals beacon — 66K wasted 404s/day

2 participants