Cache Middleware #

Cache middleware uses Web Standard’s Cache API. Cache the response according to Cache-Control headers. Cache API is supported only on Cloudflare Workers which is deployed on the custom domain. Deno will support it in the future:

Import #

import { Hono } from 'hono'
import { cache } from 'hono/cache'

Usage #

app.get('*', cache({ cacheName: 'my-app', cacheControl: 'max-age=3600' }))
© Hono developers.
Built with Hugo & Hugo Book Theme - Not Hono :)