downloader: CacheKey: include decompression flag#4067
Open
AkihiroSuda wants to merge 1 commit intolima-vm:masterfrom
Open
downloader: CacheKey: include decompression flag#4067AkihiroSuda wants to merge 1 commit intolima-vm:masterfrom
AkihiroSuda wants to merge 1 commit intolima-vm:masterfrom
Conversation
5e6507b to
ec85797
Compare
AkihiroSuda
commented
Sep 22, 2025
| k += "+decomp" | ||
| } | ||
| return k | ||
| } |
Member
Author
There was a problem hiding this comment.
(On second thought this might be rather confusing when the original data is not compressed)
The caches are now created separately for compressed and decompressed contents. When a decompressed content is cached and a compressed content is requested, the downloader now correctly returns the compressed content. - URLSHA/data: unmodified original data - URLSHA/sha256.digest: digest of the original data - URLSHA+decomp/data: decompressed data - URLSHA+decomp/sha256.digest: digest of the *original* (i.e., compressed) data Caching a decompressed content does not automatically cache the original compressed content. Signed-off-by: Akihiro Suda <[email protected]>
ec85797 to
5868ae8
Compare
Member
Author
|
ping @lima-vm/maintainers This PR has been open for more than 4 months |
unsuman
reviewed
Jan 27, 2026
| return fmt.Sprintf("%x", sha256.Sum256([]byte(remote))) | ||
| func CacheKey(remote string, decompress bool) string { | ||
| k := fmt.Sprintf("%x", sha256.Sum256([]byte(remote))) | ||
| if decompress { |
Contributor
There was a problem hiding this comment.
To address your concern, can we?
Suggested change
| if decompress { | |
| if decompress && decompressor(remote) != "" { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The caches are now created separately for compressed and decompressed contents. When a decompressed content is cached and a compressed content is requested, the downloader now correctly returns the compressed content.
Caching a decompressed content does not automatically cache the original compressed content.