Skip to content

Commit cf715eb

Browse files
committed
feat: instrument cache storage mounts
1 parent 42ef2c7 commit cf715eb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/nuxt/src/runtime/plugins/storage.server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ export default defineNitroPlugin(async _nitroApp => {
5555

5656
debug.log('[storage] Starting to instrument storage drivers...');
5757

58+
// Adds cache mount to handle Nitro's cache calls
59+
// Nitro uses the mount to cache functions and event handlers
60+
// https://nitro.build/guide/cache
61+
userMounts.add('cache:');
62+
// In production, unless the user configured a specific cache driver, Nitro will use the memory driver at root mount.
63+
// Either way, we need to instrument the root mount as well.
64+
userMounts.add('');
65+
5866
// Get all mounted storage drivers
5967
const mounts = storage.getMounts();
6068
for (const mount of mounts) {

0 commit comments

Comments
 (0)