Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

feat(size): handle content size info #49

Merged
merged 1 commit into from
Apr 20, 2017
Merged

feat(size): handle content size info #49

merged 1 commit into from
Apr 20, 2017

Conversation

zkat
Copy link
Owner

@zkat zkat commented Mar 2, 2017

This is kind of a rough sketch of keeping size information in the cache index. Even though we already verify size if it's passed in, this can make error reporting a little nicer, as well as improve on the sorts of things verify() can do (and report!).

Having size information is super handy for being able to determine whether to, say, load the entire contents of something into memory vs using streams, figuring out whether to memoize them, etc. Both make-fetch-happen and cacache itself are able to take advantage of this.

This bumps the index version to 5, too, but as usual, that's not a breaking change.

I mentioned before that this could help with SHAttered, but I didn't realize both of them were the exact same size :< -- there's a separate mitigation for that to prevent it from affecting the cache if both are inserted.

@zkat zkat removed the in-progress label Apr 20, 2017
@zkat zkat merged commit 91230af into latest Apr 20, 2017
@zkat zkat deleted the zkat/sizing branch April 20, 2017 08:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant