nitrojs / nitrojs/nitro

Use `.data/cache` for cache storage by default

Open
#2,222 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the current default from {buildDir}/cache and compare it with the proposed .data/cache location; verify how downstream builds preserve each location. Then evaluate the optional SQLite/useDatabase() approach, benchmark its filesystem-I/O impact, and use unstorage issue #400 as context; done means an agreed default migration and measured storage choice.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.