Title: `use cache` data-cache spans: instrument the cache-handler registry · Issue #24289 · getsentry/sentry-javascript · GitHub
Open Graph Title: `use cache` data-cache spans: instrument the cache-handler registry · Issue #24289 · getsentry/sentry-javascript
X Title: `use cache` data-cache spans: instrument the cache-handler registry · Issue #24289 · getsentry/sentry-javascript
Description: Example: a route handler calls async function getProducts() { 'use cache'; cacheLife('hours'); return db.query('SELECT * FROM products'); } On a miss the transaction shows an unexplained 800 ms inside executing api route, on a hit it sho...
Open Graph Description: Example: a route handler calls async function getProducts() { 'use cache'; cacheLife('hours'); return db.query('SELECT * FROM products'); } On a miss the transaction shows an unexplained 800 ms ins...
X Description: Example: a route handler calls async function getProducts() { 'use cache'; cacheLife('hours'); return db.query('SELECT * FROM products'); } On a miss the transaction shows a...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/24289
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`use cache` data-cache spans: instrument the cache-handler registry","articleBody":"\n\n\n*Example:* a route handler calls\n\n```tsx\nasync function getProducts() {\n 'use cache';\n cacheLife('hours');\n return db.query('SELECT * FROM products');\n}\n```\n\nOn a miss the transaction shows an unexplained 800 ms inside `executing api route`, on a hit it shows nothing at all. Whether the cache was consulted, whether it hit, and how stale the served content is are all invisible.\n\n*Solves:* `use cache` operations become spans in the serving trace: `cache.get` with hit/miss, `cache.put` on fills, plus entry age, TTL, and `cacheTag()` tags on hits. \n\nRelated to https://github.com/getsentry/sentry-javascript/issues/12888, does not fix it: the legacy incremental cache (fetch/ISR) stays uninstrumented, and RDC-served page hits bypass the handlers.\n\n*Fix idea:* wrap `get`/`set` on the `@next/cache-handlers-map` registry and the dev-only private handler. Guards on `globalThis` symbols (module loads once per bundle); support both install orderings (`next start` vs dev server). Keys as SHA-1 digests, never raw (PII). Report entries past `expire` as misses; enrich hits with `cache.item_age`, `cache.ttl`, `cache.tags`. Acceptance: E2E in `nextjs-16-cacheComponents`, miss→hit: `get(hit:false)` + `put` with matching digests, then `get(hit:true)` with age/TTL/tags.","author":{"url":"https://github.com/s1gr1d","@type":"Person","name":"s1gr1d"},"datePublished":"2026-09-10T10:36:02Z","url":"https://github.com/getsentry/sentry-javascript/issues/24289"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:efcdaa7a-b783-e7fa-7906-354f742132a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFDC:39FB1A:577F7B:78876E:6B0455AE |
| html-safe-nonce | 9afa9c4721058857ea4e5c4c218b23eed1eba843c4a5ea89f654015a3625c684 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkRDOjM5RkIxQTo1NzdGN0I6Nzg4NzZFOjZCMDQ1NUFFIiwidmlzaXRvcl9pZCI6IjE4NTIzNjQzMDUwMTQ3NDAzOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 76f6db443380d7f0fe3c887dc422f4d170e588944f5121760ddc0c0cc0c2957b |
| hovercard-subject-tag | issue:5411087111 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/24289/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b091c01638300966652f26fb0ac3d2e92be251dcb5fde9063ed0edab5603d0f7/getsentry/sentry-javascript/issues/24289 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b091c01638300966652f26fb0ac3d2e92be251dcb5fde9063ed0edab5603d0f7/getsentry/sentry-javascript/issues/24289 |
| og:image:alt | Example: a route handler calls async function getProducts() { 'use cache'; cacheLife('hours'); return db.query('SELECT * FROM products'); } On a miss the transaction shows an unexplained 800 ms ins... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | s1gr1d |
| hostname | github.com |
| expected-hostname | github.com |
| None | 910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e086f9b7e88322eb2b41885a6ad425b215737fa5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width