-
Notifications
You must be signed in to change notification settings - Fork 0
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
asynchronous registry fetching #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some very minor comments which are probably a matter of personal opinion. Other than that, I see no problems with the PR.
PS: Since this is a new project and is a bit outside my expertise, I would appreciate it in the future if you could increase the number of descriptive comments 🙏. Thanks!
Addressing comments from @alberto-miranda #16 (comment)
Addressing comments from @alberto-miranda #16 (comment)
3d58b00
to
cbb7f7f
Compare
Thanks for the review @alberto-miranda - I'll try to document more. I'm keeping this on hold because there are still a few performance issues I need to tackle. |
f2c60f4
to
4c3a4b7
Compare
This is ready. |
This PR introduces a mechanism that wraps the registry implementation to keep a cache of images and images tags in order to avoid asking the registry over and over.
This was a problem when using the server mode in registries with hundreds images and hundreds of tags where effectively to render the home page we need to also ask the registry for tags. That resulted in thousands of requests to the registries that were repeated over and over.
With this strategy, requests are done only after a set refresh interval
--refresh-interval
while callingserve
to tell staticreg how often to refresh its internal cache from the registry. This mechanism sits on top of the mechanism that caches the HTML of the generated web pages allowing the user to prioritize if having fresh data is more important than being fast (and making less requests) and vice versa.