A caching plugin for the Popsicle HTTP client, version 5.0.1. It provides middleware to cache HTTP responses using pluggable catbox engines. Built-in support for TTL-based expiry, cacheable conditions, serializers (JSON, stream), and handlers (freshness validation). No external caching engine is included; you must provide one (e.g., catbox-fs, catbox-memory). Updated as needed following Popsicle releases.
npm install popsicle-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creation of a Popsicle cache middleware with catbox-fs engine, usage with .use(), force update, and clean stop.
Use ES module imports (import ... from 'popsicle-cache'). If using CommonJS, stay on v4.
Ensure engine has Policy.prototype.get and Policy.prototype.set methods (from @hapi/catbox).
Use a finite TTL or custom serializer that handles Infinity.
Check if Vary headers are properly implemented; use custom handler if needed.
Use catbox-memory for ephemeral caching or configure file paths securely.
Ensure engine is passed and correctly instantiated (e.g., require('catbox-fs')({ /* options */ })).Use built-in serializers (serializers.standard() or serializers.stream()) or implement call correctly.
Use a shorter key by hashing the URL or using a custom segment.