import { Hono } from 'hono'
import { cache } from 'hono/cache'
type Bindings = {
ASSETS: Fetcher
}
const app = new Hono<{ Bindings: Bindings }>()
// Serve static HTML with caching
app.get(
'/my-page',
cache({
cacheName: 'my-app',
cacheControl: 'max-age=3600', // Cache for 1 hour
}),
async (c) => c.env.ASSETS.fetch('/file.html')
)
import { Hono } from 'hono'
import { cache } from 'hono/cache'
type Bindings = {
ASSETS: Fetcher
}
const app = new Hono<{ Bindings: Bindings }>()
// Serve static HTML with caching
app.get(
'/my-page',
cache({
cacheName: 'my-app',
cacheControl: 'max-age=3600', // Cache for 1 hour
}),
async (c) => c.env.ASSETS.fetch('/file.html')
)