{"record":{"id":"a4c13666b14590fe","repo":"vercel/next.js","slug":"pass-infinity-instead-of-false-if-you-want-to","errorCode":null,"errorMessage":"Pass `Infinity` instead of `false` if you want to cache on the client forever without checking with the server.","messagePattern":"Pass `Infinity` instead of `false` if you want to cache on the client forever without checking with the server\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/use-cache/cache-life-profile.ts","lineNumber":30,"sourceCode":"  expire?: number\n}\n\ntype CacheLifeProfileContext =\n  | { kind: 'inline' }\n  | { kind: 'config'; profileName: string }\n\nfunction normalizeCacheLifeValue(\n  key: keyof CacheLife,\n  value: unknown,\n  context: CacheLifeProfileContext\n): number | undefined {\n  if (value === undefined) {\n    return undefined\n  }\n\n  if (value === false) {\n    if (key === 'stale') {\n      throw new Error(\n        'Pass `Infinity` instead of `false` if you want to cache on the client forever ' +\n          'without checking with the server.'\n      )\n    } else if (key === 'revalidate') {\n      throw new Error(\n        'Pass `Infinity` instead of `false` if you do not want to revalidate by time.'\n      )\n    } else {\n      throw new Error(\n        'Pass `Infinity` instead of `false` if you want to cache on the server forever ' +\n          'without checking with the origin.'\n      )\n    }\n  }\n\n  if (typeof value !== 'number') {\n    throw new Error(`The ${key} option must be a number of seconds.`)\n  }","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/use-cache/cache-life-profile.ts#L12-L48","documentation":"Value normalization in normalizeCacheLifeValue: the stale key of a cacheLife profile was set to false. false is not a duration; the supported way to express \"never goes stale on the client\" is Infinity, so the guard rejects false and names the correct replacement.","triggerScenarios":"A cacheLife stale value of false is configured.","commonSituations":"Use Infinity instead of false for infinite client-side cache in cacheLife profiles.","solutions":["Use Infinity instead of false for the cacheLife stale value."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}