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
fix: handle case of zero-length cacheable route handler responses (#2819)
* test: add test case for route with 0-length response* test: add new blob key to test checking prerendered blobs after changing fixture* fix: ensure size calculation returns positive numbers and make in-memory cache failures not fatal* fix: drop unneded extra variable and also capture calculated size in warning
// very approximate size calculation to avoid expensive exact size calculation
30
39
// inspired by https://github.com/vercel/next.js/blob/ed10f7ed0246fcc763194197eb9beebcbd063162/packages/next/src/server/lib/incremental-cache/file-system-cache.ts#L60-L79
// we should also monitor cases when fallback is used because it's not the most efficient way to calculate/estimate size
58
83
// and might indicate need to make adjustments or additions to the size calculation
59
84
recordWarning(
60
85
newError(
61
-
`Blob size calculation did fallback to JSON.stringify. Kind: KnownKindFailed:${knownKindFailed},${valueToStore.value?.kind??'undefined'}`,
86
+
`Blob size calculation did fallback to JSON.stringify. EstimatedKnownTypeSize:${estimatedKnownTypeSize}, CalculatedSize:${calculatedSize}, ValueToStore:${JSON.stringify(valueToStore)}`,