nitro
nitro copied to clipboard
Expired cache entries do not get flushed
Environment
Nitropack 2.8.1 Nuxt 3.10.1
Reproduction
Reproduction repo: https://stackblitz.com/edit/github-g1zu3w
- Start the app
- Click on "Go to A"
- See that "A" renders
- go back to the index route
- Click "Go to B"
- See that "B" renders
- Go in the file explorer to "/.nuxt/cache/nitro/routes/_" and see there are 3 records (index, A and B)
- Refresh "B" after more than 5 seconds
- See that the cache-record of "B" is updated, but the cache-record of "A" is still present (the fact that it stays present is the problem)
Describe the bug
When using SSR with cache old expired records never get flushed. This results in the filesystem or memory (depending on what cache-storage is used) to fill up over time.
Note that every unique URL is a cache-record, this includes query-parameters. So users can potentially fill up the cache of any Nuxt/Nitro server with ease, resulting in down time.
Additional context
No response
Logs
No response