What problem does it solve?
This Skill caches the results of expensive file processing tasks, like text extraction or image analysis, using content hashes. This ensures that if a file's content hasn't changed, even if its name or location has, the cached result is used, saving computational resources and time.
Core Features & Use Cases
- Content-Based Caching: Uses SHA-256 hashes of file content as cache keys, making it resilient to file renames or moves.
- Automatic Invalidation: Cache entries are automatically invalidated when the file content changes.
- Service Layer Separation: Keeps the core file processing logic pure and separates caching concerns into a distinct service layer.
- Use Case: When building a pipeline that processes many PDFs, this pattern ensures that if the same PDF is encountered multiple times, its text is extracted only once.
Quick Start
Use the content-hash-cache-pattern skill to extract text from the file located at '/path/to/document.pdf', enabling caching.