From a606de3e0b401cea19270021bce45af508a175c7 Mon Sep 17 00:00:00 2001 From: Vercel Date: Wed, 29 Jul 2026 18:28:09 +0000 Subject: [PATCH] Install and configure Vercel Speed Insights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Vercel Speed Insights Implementation Report ## Summary Successfully implemented Vercel Speed Insights for the CAIRN ETP website following the latest official documentation. ## Changes Made ### 1. Package Installation - Installed `@vercel/speed-insights` v2.0.0 via npm - Updated `package.json` with the new dependency - Generated `package-lock.json` with locked dependency versions ### 2. Speed Insights Integration Added Vercel Speed Insights tracking scripts to both HTML pages: #### Modified Files: - **index.html** - Added Speed Insights initialization and script loader in the `` section - **book.html** - Added Speed Insights initialization and script loader in the `` section #### Implementation Details: Used the static site approach as recommended in the Vercel documentation: - Added initialization script that creates the `window.si` function and queue (`window.siq`) - Added deferred script tag to load `/_vercel/speed-insights/script.js` - Placed scripts at the end of the `` section for optimal loading ### 3. Framework-Specific Approach This project is a static HTML/CSS/JS website served by FastAPI. Based on the Vercel documentation, I used the "without a package manager" approach which is ideal for static sites: - No build process changes required - No JavaScript module bundling needed - Clean inline script integration ## Verification Steps Completed ✅ Installed the @vercel/speed-insights package ✅ Added Speed Insights scripts to both HTML pages (index.html and book.html) ✅ Verified build completes successfully (`npm run build`) ✅ Validated HTML syntax for both files using Python HTML parser ✅ Confirmed Speed Insights script tags are present in both pages ✅ Updated package-lock.json with dependency resolution ## Next Steps for Deployment After deployment to Vercel: 1. Enable Speed Insights in the Vercel dashboard for this project 2. Deploy the updated code to Vercel 3. The `/_vercel/speed-insights/script.js` endpoint will be automatically available 4. Speed Insights will start collecting performance metrics automatically 5. View performance data in the Vercel Dashboard under Speed Insights ## Technical Notes - The implementation uses the recommended static site approach from the official Vercel documentation - Speed Insights will only track data in production mode (not in development) - The script loads with `defer` attribute to avoid blocking page rendering - Both main pages (homepage and book page) now include Speed Insights tracking - The FastAPI backend doesn't require any changes as it serves static HTML files ## Files Modified - `index.html` - Added Vercel Speed Insights scripts - `book.html` - Added Vercel Speed Insights scripts - `package.json` - Added @vercel/speed-insights dependency - `package-lock.json` - Generated with locked versions (new file) All changes preserve the existing code structure and only add the necessary Speed Insights functionality. Co-authored-by: Vercel --- book.html | 6 ++++++ index.html | 6 ++++++ package-lock.json | 54 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 ++++- 4 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/book.html b/book.html index 3579e4b..9cf2a9a 100644 --- a/book.html +++ b/book.html @@ -35,6 +35,12 @@ + + + + diff --git a/index.html b/index.html index 756b1b3..ee43113 100644 --- a/index.html +++ b/index.html @@ -35,6 +35,12 @@ + + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..50969f4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,54 @@ +{ + "name": "cairn-etp-website", + "version": "2.4.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cairn-etp-website", + "version": "2.4.0", + "license": "MIT", + "dependencies": { + "@vercel/speed-insights": "^2.0.0" + } + }, + "node_modules/@vercel/speed-insights": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-2.0.0.tgz", + "integrity": "sha512-jwkNcrTeafWxjmWq4AHBaptSqZiJkYU5adLC9QBSqeim0GcqDMgN5Ievh8OG1rJ6W3A4l1oiP7qr9CWxGuzu3w==", + "license": "Apache-2.0", + "peerDependencies": { + "@sveltejs/kit": "^1 || ^2", + "next": ">= 13", + "nuxt": ">= 3", + "react": "^18 || ^19 || ^19.0.0-rc", + "svelte": ">= 4", + "vue": "^3", + "vue-router": "^4" + }, + "peerDependenciesMeta": { + "@sveltejs/kit": { + "optional": true + }, + "next": { + "optional": true + }, + "nuxt": { + "optional": true + }, + "react": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vue": { + "optional": true + }, + "vue-router": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json index 3a49f9d..900c166 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,8 @@ "ai-governance" ], "author": "Chris Yarwood (cyarwood80)", - "license": "MIT" + "license": "MIT", + "dependencies": { + "@vercel/speed-insights": "^2.0.0" + } }