Skip to content

feat(cache): add PackumentCache API and defaultCacheDir for shared caching#27

Draft
indexzero wants to merge 1 commit intomainfrom
feat/expose-cache
Draft

feat(cache): add PackumentCache API and defaultCacheDir for shared caching#27
indexzero wants to merge 1 commit intomainfrom
feat/expose-cache

Conversation

@indexzero
Copy link
Owner

Add a high-level PackumentCache class that hides cache key construction, storage driver creation, and CacheEntry encode/decode from consumers. This enables flatcover and _all_docs CLI to share a single packument cache with origin-keyed entries and content-addressable storage.

  • PackumentCache: get/put/has/conditionalHeaders with origin isolation
  • defaultCacheDir(): platform-aware XDG/macOS/Windows cache resolution
  • CacheEntry.lastModified getter for If-Modified-Since support
  • CacheEntry.setBodyRaw() zero-stringify fast path for write operations
  • CacacheDriver: inline cacache wrapper with string passthrough
  • cacache added as optionalDependency for Node.js environments

…ching

Add a high-level PackumentCache class that hides cache key construction,
storage driver creation, and CacheEntry encode/decode from consumers.
This enables flatcover and _all_docs CLI to share a single packument
cache with origin-keyed entries and content-addressable storage.

- PackumentCache: get/put/has/conditionalHeaders with origin isolation
- defaultCacheDir(): platform-aware XDG/macOS/Windows cache resolution
- CacheEntry.lastModified getter for If-Modified-Since support
- CacheEntry.setBodyRaw() zero-stringify fast path for write operations
- CacacheDriver: inline cacache wrapper with string passthrough
- cacache added as optionalDependency for Node.js environments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant