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: https://deno.com/deploy/docs/runtime-api.

Import #

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

Usage #

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