Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize persistent cache strategy #1208

Open
wre232114 opened this issue Apr 18, 2024 · 3 comments
Open

Optimize persistent cache strategy #1208

wre232114 opened this issue Apr 18, 2024 · 3 comments

Comments

@wre232114
Copy link
Member

wre232114 commented Apr 18, 2024

What problem does this feature solve?

Currently when lockfile is changed, all cache will be invalidated. For some dependencies like components, they could be changed frequently, so Farm need to support configuring that if some packages are changed, only caches of these packages are invalidated, caches of other packages should be reused.

What does the proposed API look like?

  1. add a loose: boolean, when keys like lockfile changed with loose: true, all cache should not be invalidated, and Farm should validate cache for immutable modules.
  2. optimize optimize_module_graph and render_resource_pot_modules cache. optimize_module_graph should be cached to skip unnecessary calculations. and cache of render_resource_pot_modules should considering used exports info of the modules.
  3. Config can be modified in rust plugins, farm should use final config to generate cache key for global keys.
@289420843
Copy link

有进展吗?我非常关心该功能

@wre232114
Copy link
Member Author

正在实现中,会优先支持

@wre232114
Copy link
Member Author

可设置 persistentCache: { globalBuiltinCacheKeyStrategy: { lockfile: false } } } 关闭 lockfile 的检查

@wre232114 wre232114 added this to the V1.2.0 milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants