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 去命中缓存
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 去命中缓存