Skip to main content

Module cache

Module cache 

Source
Expand description

The content-addressed package cache (docs/ROADMAP.md epic E1.6, ADR-0002 §7).

The cache lives at ~/.ridl/cache (ADR-0002 §7), indexed by URL and by the SHA-256 content hash of the fetched artifact. A cached entry is never re-fetched as long as the hash on record matches. The layout is

<root>/<sha256(url)>/<sha256(artifact)>/…unpacked package files…

The URL is hashed into the first path segment so the cache is indexed by URL (ADR-0002 §7); the artifact hash is the second segment so the same URL can hold more than one pinned version. The fetched artifact is an uncompressed tar archive of one package directory (ADR-0007 decision 12, provisional until the registry spec E7.4); Cache::store unpacks it into the entry directory.

This module sits behind the fetch feature: it hashes with sha2 and unpacks with tar, and the content-addressed cache only exists when remote fetch is compiled in.

Structs§

Cache
The on-disk package cache, rooted at Cache::root.