Implements path-independent, auto-invalidating cache systems for expensive file processing tasks using SHA-256 content hashing.
The Content-Hash Cache Pattern provides a robust architectural template for optimizing expensive file operations like PDF parsing, OCR, and image analysis within Claude Code environments. By using SHA-256 hashes of file contents as cache keys rather than fragile file paths, this skill ensures that cache hits occur even after files are moved or renamed, while guaranteeing automatic invalidation the moment content changes. It emphasizes clean code principles by separating caching logic into a service layer, keeping core processing functions pure and maintainable.
주요 기능
01Automatic cache invalidation triggered by file content changes
02SHA-256 content-based indexing for path-independent caching
03Memory-efficient chunked hashing for large file processing
04O(1) lookup performance using hash-based JSON storage
050 GitHub stars
06Service layer separation to maintain pure processing functions
사용 사례
01High-cost file processing pipelines such as PDF text extraction