Skip to content

IPFS: cache stores more data than is necessary #30

@djdv

Description

@djdv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions