I am experiencing an issue with a script (/_vercel/insights/script.js) still being served on my site even after I have disabled Speed Insights in my project settings. Despite clearing the cache multiple times, the script continues to appear in the HTTP response headers. Below is an example of the response:
Is Web Analytics enabled for the project? In that case, you would still see /_vercel/insights/* routes because the same path is used.
If not, could you also let us know if you have also removed the analytics package and inject function from your application? It’s possible that leftover scripts included in the project could be adding these extra routes.
I understand that this script is necessary for Analytics to function properly, but I would like to know:
What would happen if I add long-term caching for this file?
Would caching affect its functionality or analytics data accuracy in any way?
I’m also asking because PageSpeed Insights flags this script as needing an efficient cache policy, so I’m wondering what the best practice would be for optimizing caching without affecting Analytics.