You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 11b4573
Browse filesBrowse the repository at this point in the historyBrowse files
feat(nextjs): Mark pageloads that were served from a cached shell
A visitor of a cached page gets a pageload in its own trace with no server
span, which looks like missing server instrumentation. While Next.js
prerenders a document, the server now writes a `sentry-shell` meta tag with
the trace of the prerender instead of nothing. The client never continues
it: it sets `sentry.nextjs.cached_shell` on the pageload and adds a
`cache_origin` span link to the request that generated the shell.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@
8
8
9
9
Pageloads of apps with `cacheComponents` enabled are connected to their server request again. Pages that Next.js prerenders no longer carry trace information, so a cached page can no longer connect visitors to a request that was not theirs. This also applies to ISR pages. The pageload waits for the trace information when it arrives with the part of the page that streams in after a cached shell.
10
10
11
+
- **feat(nextjs): Mark pageloads that were served from a cached shell**
12
+
13
+
A pageload whose document is a shell that Next.js prerendered at runtime, for example an ISR page or a `cacheComponents` page generated on first visit, now carries the `sentry.nextjs.cached_shell` attribute and a `cache_origin` span link to the request that generated the shell. That tells apart "nothing ran on the server for this visit" from missing server instrumentation. The link is never continued as a parent, so pageloads keep their own traces and sampling decisions.
Copy file name to clipboardExpand all lines: dev-packages/e2e-tests/test-applications/nextjs-16-cacheComponents/tests/cacheOrigin-pageloadConnection.spec.ts
Copy file name to clipboardExpand all lines: dev-packages/e2e-tests/test-applications/nextjs-16-streaming-cacheComponents/tests/cacheOrigin-pageloadConnection.spec.ts
0 commit comments