Skip to content

【bug】缓存总是命中 #8

@bob-zebedy

Description

@bob-zebedy

https://github.com/klever1988/cachewrtbuild/blob/4e49fc2aa43955b2933541b0372f7416f7dac23d/fetch.js#L18-L19
由于 restoreKeys = ['cache-openwrt']restoreKeys = ['cache-openwrt', 'cache-openwrt-<commithash>']
下面再查缓存的时候
https://github.com/klever1988/cachewrtbuild/blob/4e49fc2aa43955b2933541b0372f7416f7dac23d/fetch.js#L40
keyString 包含时间戳,肯定不会命中,所以会用 restoreKeys 依次去查
但是因为缓存的 key = cache-openwrt-<commithash>-<timestamp>
所以 restoreKeys 中的 cache-openwrt 一定会命中缓存
也就是说不管工具链的commithash有没有发生变化,只要缓存存在就一定会命中,那这个还有什么意义呢?

建议将 restoreKeys 只添加一个 restoreKeys = ['cache-openwrt-<commithash>'] 这样可以根据工具链的 commithash 去命中缓存

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions