Repository navigation
fix(nextjs): Keep unsampled prerenders free of per-render meta tags - #27009
Conversation
A prerender wrote its trace and start time into the HTML even when it was not sampled. The client ignores an unsampled trace, so the values only made every ISR regeneration differ from the previous one, which Vercel bills as a write. An unsampled prerender now writes an empty `sentry-cache-origin` tag and no `sentry-render-start` tag. Refs #27002 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
size-limit report 📦Compared: 382ef3b (PR test merge using develop at 0c4dd26) Against: 0c4dd26 (develop) · base run #68418 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsAll optional checks were successful. 7 successful. See the run. Successful checks
|
|
This is fixing it for Next.js but we probably have the same problem in SvelteKit and Nuxt. They behave they same and they could also be deployed on Vercel. I think we should rather fix this for all in the end. Maybe we can modify |
|
Next.js does not use |
## What Adds a `deterministicPrerenders` option to `withSentryConfig`. With it, no prerender writes its trace or start time into the HTML, so the output of an ISR regeneration stays identical when the content did not change. ## Why After #27009, a sampled prerender still changes the HTML on every regeneration, which Vercel bills as an ISR write. Users with large pages or a high sample rate need a way to turn that off. The option costs the `cache_origin` link and `page.server_rendering.age` on pageloads of prerendered pages, so it is off by default. Pageloads keep `page.server_rendering.type`. Stacked on #27009. Closes: #27002 --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…a tags (#27017) ## What SvelteKit and Nuxt pages rendered by an unsampled request now get an empty `sentry-cache-origin` tag and no `sentry-render-start` tag. Sampled renders and pages prerendered in the build are unchanged. ## Why Follow-up to #27009, which fixed this for Next.js only. SvelteKit and Nuxt write the tags through a shared helper in core with the same problem: an unsampled render changed the cached HTML on every regeneration, which Vercel bills as an ISR write. The tag stays, with empty content, so pageloads keep `page.server_rendering.type`. They lose `page.server_rendering.age` for unsampled renders. Stacked on #27010. Refs: #27002 Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
What
A prerender that is not sampled now writes an empty
sentry-cache-origintag and nosentry-render-starttag. Sampled prerenders are unchanged.Why
The client ignores the trace of an unsampled prerender, so the two values only made the HTML of every ISR regeneration differ from the previous one. Vercel bills a regeneration as a write only when its output changed, so this cost users money for nothing. The tradeoff is that pageloads of pages from an unsampled prerender no longer report
page.server_rendering.age. They keeppage.server_rendering.type.Refs: #27002