Nuxt · Caching

NUXT0062Do not cache personalized handlers without varying

Flags personalized cached handler in Nuxthub project code before it leaks into runtime behavior.

Why it happens

Cached server responses are shared beyond one request. Personalized data in a shared cache can leak state or serve stale content.

Fix

Remove personalized cached handler, or move it to the Nuxthub runtime/API that owns that behavior.

Example

Avoid personalized cached handlers

Before

export default cachedEventHandler(async (event) => {
  const session = await getUserSession(event)
  return session.user
})

After

export default defineEventHandler(async (event) => {
  const session = await getUserSession(event)
  return session.user
})

Verify the fix

Run only this rule after editing so the report stays focused on the diagnostic you are closing:

pnpm nuxt doctor --rules nuxthub/no-personalized-cached-handler
Copyright © 2026