diff --git a/docs/getting-started/bun.md b/docs/getting-started/bun.md index 9779395b..760ce7c6 100644 --- a/docs/getting-started/bun.md +++ b/docs/getting-started/bun.md @@ -135,6 +135,22 @@ app.get( ) ``` +### `onFound` + +You can specify handling when the requested file is found with `onFound`: + +```ts +app.get( + '/static/*', + serveStatic({ + // ... + onFound: (_path, c) => { + c.header('Cache-Control', `public, immutable, max-age=31536000`) + }, + }) +) +``` + ### `onNotFound` You can specify handling when the requested file is not found with `onNotFound`: diff --git a/docs/getting-started/deno.md b/docs/getting-started/deno.md index 998ece9c..a098ae0a 100644 --- a/docs/getting-started/deno.md +++ b/docs/getting-started/deno.md @@ -122,6 +122,22 @@ app.get( ) ``` +### `onFound` + +You can specify handling when the requested file is found with `onFound`: + +```ts +app.get( + '/static/*', + serveStatic({ + // ... + onFound: (_path, c) => { + c.header('Cache-Control', `public, immutable, max-age=31536000`) + }, + }) +) +``` + ### `onNotFound` You can specify handling when the requested file is not found with `onNotFound`: