-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(docker): Long-term cache for Docker Hub tags #28489
feat(docker): Long-term cache for Docker Hub tags #28489
Conversation
@zharinov can we rethink how this long term caching works? Ideally we don't want to expire a valid cache ever. So for example we set a hard expiry limit of X days. I no updates, and no use in X days, then we expire the cache. But if there's any update within the X days, or access within <0.5X left, then we update the cache. e.g. let's say the cache expiry is 10 days. It's created on day 0, expires day 10. If on day 1 it's updated, then it now expires on day 11. Now assume it's not updated, so expiry remains on day 11, and we have reached day 7 and it's accessed. Because <5 days remain, we then push the cache expiry out again to day 17. In other words we never expire a cache as long as it's accessed approximately once every half X. I think in your current approach that we'll expire after 90 days if no new tags released in that time? |
30 days
Seems like we have to extend our package cache API to read/write TTL data, otherwise we have to rewrite payload on every access operation. Relevant commands for Redis: Also I could figure out the query for the SQLite backend, however we could do nothing but rewrite for the |
I'm ok with rewriting the payload once every 15 days |
Yes, but also I don't want to overcomplicate this logic. How about something like this:
|
Anyway, this should be a separate issue/PR |
I'm trying to test this locally over night/tomorrow with a few scenarios |
🎉 This PR is included in version 37.308.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Changes
Context
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: