Skip to content

Conversation

@TheodoreRed
Copy link

📓 What's in there?

This PR improves the script injection process for Vercel Speed Insights by adding a warm-up function. Before injecting the main script, the code performs a fetch to the script URL to "warm up" the endpoint (even if the first response might be HTML). This change is intended to reduce errors related to cold starts, ensuring that when the actual script is loaded, the endpoint is ready to serve valid JavaScript.

Issue #98

🧪 How to test?

Open a page that uses Speed Insights injection.

Verify that the script tag is appended to the document head after the warm-up call.

❗ Notes to reviewers

This change is purely additive and does not affect the core functionality of Speed Insights.

Please verify that this approach reduces errors associated with cold starts without introducing side effects in both development and production environments.

@vercel
Copy link

vercel bot commented Mar 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
speed-insights-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm
speed-insights-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm
speed-insights-nuxt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm
speed-insights-remix ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm
speed-insights-sveltekit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm
speed-insights-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 11:20pm

@vercel
Copy link

vercel bot commented Jan 8, 2026

@TheodoreRed is attempting to deploy a commit to the Analytics Test Projects Team on Vercel.

A member of the Team first needs to authorize it.

@bhaktatejas922
Copy link

🤖 AI Preview Test

Hey! We noticed you're doing amazing open source work. We built an AI model that's really good at testing web applications, so we ran it on your preview deployment to help catch any issues.

Preview URL: https://speed-insights-astro-git-fork-theodorered-main-vercel-analytics.vercel.app

What We Found

✅ Preview deployment detected and queued for testing.


Want unlimited free access? We'd love to support your project with free AI-powered testing!

If you'd rather we not comment on your PRs, just 👎 this message and we'll remove you from our list.

Automated by MorphLearn more

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants