Nuxt · Caching
NUXT0063Cache expensive public server handlers
Finds Nuxthub project code that should use the supported cached event handler pattern instead.
vite-doctor/nuxthubcacheinfoSuggestion
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
Use the Nuxthub-supported cached event handler pattern instead.
Example
Cache public expensive handlers
Before
export default defineEventHandler(async () => {
return await queryCollection('docs').all()
})
After
export default cachedEventHandler(async () => {
return await queryCollection('docs').all()
})
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/prefer-cached-event-handler