Skip to content

Feature/local storage cache #33

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

Merged
merged 4 commits into from
Dec 21, 2023

Conversation

fleskesvor
Copy link
Contributor

This PR adds a cache to extensions read from the file system, similar to the one used for extensions read from an Artifactory repository.

My use case is that i have many (6000+) extensions with different versions on disk, and walking through all of them takes upwards of 3 minutes for every single API call. With a cache in place, I can instead pre-fill the cache at regular time intervals, and respond to API calls within ~300 milliseconds.

I have tried to emulate the existing code style with my changes, but my Go skills are admittedly a bit rusty, so I welcome any feedback, and will try to make changes as best I can.

This PR also does not address the issue of evicting the cache on adding/removing extensions that has been noted in a TODO in the Artifactory implementation, but hopefully that can be tackled as a future improvement.

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic improvement! Code looks perfect.

fleskesvor and others added 2 commits December 21, 2023 22:37
Makes the description more precise, as there's no separate handling of manifest.

Co-authored-by: Asher <[email protected]>
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@code-asher code-asher merged commit c061a1e into coder:main Dec 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@code-asher
Copy link
Member

Released in v2.1.0.

@fleskesvor fleskesvor deleted the feature/local-storage-cache branch October 3, 2024 09:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants