You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a benefit that does not require user interaction
Non-Goals
Change any functionality of next.js
Background
distDir, specifically its subfolder cache, can become rather large, but does not seem to be worth backing up, usually, as its content can (and is, often) easily recreated.
bford.info/cachedir proposes a simple convention: add a file named CACHEDIR.TAG to directories that are, well caches.
This approach has been widely adopted, well beyond the examples given on that website. Modern examples include Rust/Cargo (which add the tag to several directories) and Borg Backup, which has a dedicated flag to ignore thus-marked directories.
Adding CACHEDIR.TAG to distDir manually does not work, as next build removes it.
Adding cache/CACHEDIR.TAG to distDir manually seems to work. (but see #6009)
Proposal
Ensure that distDir (default: .next) always contains CACHEDIR.TAG.
Failing that, ensure that <distDir>/cache always contains CACHEDIR.TAG.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
distDir
, specifically its subfoldercache
, can become rather large, but does not seem to be worth backing up, usually, as its content can (and is, often) easily recreated.bford.info/cachedir proposes a simple convention: add a file named
CACHEDIR.TAG
to directories that are, well caches.This approach has been widely adopted, well beyond the examples given on that website. Modern examples include Rust/Cargo (which add the tag to several directories) and Borg Backup, which has a dedicated flag to ignore thus-marked directories.
Adding
CACHEDIR.TAG
todistDir
manually does not work, asnext build
removes it.Adding
cache/CACHEDIR.TAG
todistDir
manually seems to work. (but see #6009)Proposal
Ensure that
distDir
(default:.next
) always containsCACHEDIR.TAG
.Failing that, ensure that
<distDir>/cache
always containsCACHEDIR.TAG
.Beta Was this translation helpful? Give feedback.
All reactions