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

[Bug]: Cache timestamp changes lead to invalidation? #9064

Open
cskunkun opened this issue Jan 21, 2025 · 1 comment
Open

[Bug]: Cache timestamp changes lead to invalidation? #9064

cskunkun opened this issue Jan 21, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@cskunkun
Copy link

System Info

macos,linux也是如此

Details

使用缓存构建

tools: {
  rspack: {
    cache: true,
    experiments: {
      cache: { type: 'persistent' },
    },
  },
}

把node_modules下的.cache/rspack压缩一遍,把原文件夹删掉,再解压获得一个文件夹,会导致缓存验证失败,理论上缓存没有变化。
⚠ validate scope occasion_make_dependencies failed due to some packs are modified。

是否是因为timestamp变化导致缓存验证失败,如何解决?

Reproduce link

No response

Reproduce Steps

  1. 使用缓存构建
  2. 把缓存文件压缩一遍,删掉原缓存文件
  3. 解压还原缓存文件
  4. 缓存验证失败
@cskunkun cskunkun added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 21, 2025
@chenjiahan chenjiahan changed the title [Bug]: 缓存timestamp变化导致失效? [Bug]: Cache timestamp changes lead to invalidation? Jan 26, 2025
@chenjiahan chenjiahan removed the pending triage The issue/PR is currently untouched. label Jan 26, 2025
@jerrykingxyz
Copy link
Contributor

jerrykingxyz commented Jan 26, 2025

cache 的失效检测目前会校验文件的 修改时间,所以解压之后这些文件的 修改时间 都更新了,导致缓存校验失败。这个问题预计会在下个版本修复。


The cache invalidation detection currently verifies the modification time of the files, so after decompression, the modification time of these files is updated, causing the cache verification to fail. This problem is expected to be fixed in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants