Skip to content

feat(core): disk cache storage for generated variants - #8

Merged
dangreen merged 1 commit into
mainfrom
add-core-cache
Aug 5, 2026
Merged

feat(core): disk cache storage for generated variants#8
dangreen merged 1 commit into
mainfrom
add-core-cache

Conversation

@dangreen

@dangreen dangreen commented Aug 5, 2026

Copy link
Copy Markdown
Member

Adds SrcSetCacheStorage - a disk cache of generated image variants.

  • memo skips repeated generation: variants are stored on disk with a manifest and read back on repeated generation with the same source, options and variant
  • Cache addresses are derived from the inputs before generating: manifests are keyed by a sha256 of the source contents, path and generation options; files are stored under the plain variant name for direct serving
  • Manifest stores a contents hash: files overwritten by a colliding name are a miss with regeneration
  • Atomic writes (tmp + rename), flat-name path guard, sharp versions and a cache schema version in the key
  • SrcSetGenerator accepts the storage via the cache option; variant naming is unified in resolveVariant, shared by the generator and the storage

🤖 Generated with Claude Code

@dangreen
dangreen merged commit 4a1bf7d into main Aug 5, 2026
7 checks passed
@dangreen
dangreen deleted the add-core-cache branch August 5, 2026 14:36
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
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