You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nitro persists `defineCachedEventHandler` results to disk at `.nuxt/cache/nitro/`. This cache **survives dev server restarts**. If you're iterating on a cached API route and want fresh results, delete the relevant cache directory:
131
+
132
+
```bash
133
+
# Clear all Nitro handler caches
134
+
rm -rf .nuxt/cache/nitro/handlers/
135
+
136
+
# Clear a specific handler cache (e.g. picks)
137
+
rm -rf .nuxt/cache/nitro/handlers/npmx-picks/
138
+
```
139
+
140
+
Alternatively, you can bypass the cache entirely in development by adding `shouldBypassCache: () => import.meta.dev` to your `defineCachedEventHandler` options:
141
+
142
+
```ts
143
+
exportdefaultdefineCachedEventHandler(
144
+
asyncevent=> {
145
+
// ...
146
+
},
147
+
{
148
+
maxAge: 60*5,
149
+
shouldBypassCache: () =>import.meta.dev,
150
+
},
151
+
)
152
+
```
153
+
154
+
The `.cache/` directory is a separate storage mount used for fetch-cache and atproto data.
0 commit comments