A filesystem store for node-cache-manager that stores binary data as separate files, returning them as readable streams or buffers. Version 1.0.4 is the latest stable release. It supports limiting disk space, refilling cache on restart, and storing buffers either as separate files or within the JSON cache file. Designed for caching binary data like images with streaming support via response piping. Suitable for Node.js 4, 5, and iojs.
npm install cache-manager-fs-binaryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a filesystem cache with binary stream support, wrap a cache miss function, and handle the resulting stream.
Ensure your callback handles the modified object; use binaryAsStream option to control stream vs buffer.
Set ttl in seconds, e.g., 3600 for one hour.
Use an absolute path or ensure the working directory is correct.
Sanitize keys to avoid characters like /, :, *, etc.
Create the directory before caching, or set 'preventfill: true' and ensure path exists.
Ensure your cached object has a 'binary' property with a Buffer. Check if TTL expired and re-fetch.
Avoid circular structures; cache only plain JSON-serializable data under non-binary keys.
Increase event listener limit or ensure callbacks are registered properly. Consider using 'multicache' to limit concurrent operations.