-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throttle calls to package registry for version resolution
The 'HEAD' call that is done to resolve package revisions from unpinned versions is already quite cheap, but it would still be better to avoid overloading Github with such calls; especially for users of a language-server that would compile on-the-fly very often. Upstream packages don't change often so there's no need to constantly check the etag. So we now keep a local version of etags that we fetched, as well as a timestamp from the last time we fetched them so that we only re-fetch them if more than an hour has elapsed. This should be fairly resilient while still massively improving the UX for people showing up after a day and trying to use latest 'main' features. This means that we now effectively have two caching levels: - In the manifest, we store previously fetched etags. - In the filesystem, we have a cache of already downloaded zip archives. The first cache is basically invalidated every hour, while the second cache is only invalidated when a etag changes. For pinned versions, nothing is invalidated as they are considered immutable.
- Loading branch information
Showing
5 changed files
with
90 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters