Skip to content

Commit 0ec4b7a

Browse files
committed
docs: mention shouldBypassCache
1 parent 3654779 commit 0ec4b7a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ rm -rf .nuxt/cache/nitro/handlers/
137137
rm -rf .nuxt/cache/nitro/handlers/npmx-picks/
138138
```
139139

140+
Alternatively, you can bypass the cache entirely in development by adding `shouldBypassCache: () => import.meta.dev` to your `defineCachedEventHandler` options:
141+
142+
```ts
143+
export default defineCachedEventHandler(
144+
async event => {
145+
// ...
146+
},
147+
{
148+
maxAge: 60 * 5,
149+
shouldBypassCache: () => import.meta.dev,
150+
},
151+
)
152+
```
153+
140154
The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data.
141155

142156
### Project structure

0 commit comments

Comments
 (0)