Skip to content
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

IPFS: cache stores more data than is necessary #30

Open
djdv opened this issue Jun 29, 2023 · 0 comments
Open

IPFS: cache stores more data than is necessary #30

djdv opened this issue Jun 29, 2023 · 0 comments

Comments

@djdv
Copy link
Owner

djdv commented Jun 29, 2023

Extracted from: #27 (comment)

Currently we fetch and cache IPLD nodes so that we can reduce the amount of requests made to the IPFS node.
We use this data primarily for path traversal (to avoid calling core.Resolve{Path,Node}), but store the entire node, which can contain block data that we currently don't use/need.

At least for IPFS, we should be able to take advantage of the immutability of paths.
So we could use the Go fs.FS path as a cache key instead of a cid, and instead store the cid (and whatever else we require) in that record.
We can probably do the same thing for IPNS as long as we continue using some cache eviction condition.

Related: #29
We will depend on path resolution being correct before we can rely on caching the results of a path traversal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant