It's not possible to cache both /foo and /foo/bar when using fs or fs-lite as the storage driver:
// nitro.config.ts (or nitro section of nuxt.config.ts)
storage: {
cache: { driver: "fs-lite", base: ".cache/nitro" },
}npm install
npx nitro dev- Open http://localhost:3000 — index page with links
- Click
/foo— payload is cached, creates file at.cache/nitro/foo - Click
/foo/bar— tries to cache payload, needs.cache/nitro/footo be a directory → ENOTDIR
Both routes cache their payloads successfully.
Visiting /foo/bar after /foo crashes with:
ENOTDIR: not a directory, open '.cache/nitro/foo/bar'