/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-oncachenotavailable-cf42d1fa3472-oncachenotavailable-void-promise-false-s0284-c0000.md
onCacheNotAvailable: `(() => void | Promise )` | `false` - hono-docs
onCacheNotAvailable: (() = void | Promise ) | false Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.t...
onCacheNotAvailable: (() => void | Promise ) | false
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#oncachenotavailable-void-promise-false
Summary
A callback function or false that controls the behavior when the Cache API is not available in the global scope. By default, a message is logged with console.log. You can provide a custom function to customize the behavior, or set it...
Content
A callback function or false that controls the behavior when the Cache API is not available in the global scope. By default, a message is logged with console.log. You can provide a custom function to customize the behavior, or set it to false to suppress the log entirely.
// Custom logging
app.use(
cache({
cacheName: 'my-app-v1',
onCacheNotAvailable: () => {
console.log('Custom log: Cache API is not available.')
},
})
)// Suppress logging
app.use(
cache({
cacheName: 'my-app-v1',
onCacheNotAvailable: false,
})
)