Dependencies Cache Mechanism
To improve component-loading performance, the dependencies data is cached in the filesystem.
The component's cache gets invalidated in the following scenario:
- The component-dir or sub-dirs have been changed. (modified-date of the dirs paths)
- One of the component files have been changed.
- A component config file (component.json/package.json) has modified.
The entire cache of all component dependencies is invalidated if one of the following happened:
- workspace-config file (workspace.jsonc) has changed.
- package.json file has changed.
- node_modules-dir (only root dir, not sub-dirs) has changed. - not sure if needed.
- On completion of "bit link".
- On completion of "bit install".
- During 'bit tag --persist', before loading the components.
A component is not entered to the cache in the first place in the following cases:
- No root-dir/track-dir (legacy).
- Component has one of the following issues: missingPackagesDependenciesOnFs, untrackedDependencies.
Limitations:
- If a user deleted the dists directories of a component in node-modules, we don't know about it and bit-status won't show any error.
- If a user deleted a package from node-modules dir manually, we don't know about it.
Disabling the cache
set the "no-fs-cache" feature.
For one command, prefix your command with BIT_FEATURES=no-fs-cache
.
Or you can configure it on the machine level for all commands/workspaces: bit config set features='no-fs-cache'