Use `.data/cache` for cache storage by default
Currently we use {buildDir}/cache for cache storage by default but the downside is that, downstream frameworks (Nuxt) might choose to remove it entirely on each build causing to loose the cache.
As part of this directory migration, we might use a SQLite database now that we have useDatabase() to reduce FS IO overhead. (to be benchmarked also depends on https://github.com/unjs/unstorage/issues/400)
I think that moving the cache directory to .data/cache is a good idea for consistency between Nitro & other FE frameworks.
Regarding SQLite database, I am not 100% sure as it can be quite slow in edge environment (ex: D1) as they don't have replication yet. To be benchmarked indeed. There could also be a way of usingunstorage + SQLite driver.
Do you plan to use another database for the cache as well and make it configurable somehow?
I am not 100% sure as it can be quite slow in edge environment (ex: D1)
Per preset, we can decide and it is (and remains) in "memory" by default.
I am suggesting different cache storage for Dev and Server deployment with SQLite support (Node.js, Bun). It needs to be benchmarked but in theory, reducing IO and batching it should gain perf.
Do you plan to use another database for the cache as well and make it configurable somehow?
Same as today, cache storage can be configured using unstorage cache: mount. See this relevant tracker: https://github.com/unjs/unstorage/issues/400