express-cache-ctrl

JSON →
library 1.2.0 ·javascript
verified Jun 7, 2026

Express middleware to manage the Cache-Control header for HTTP caching. Version 1.2.0 is the latest stable release. It provides simple functions like `public()`, `private()`, `disable()`, `secure()`, and `custom()` to set caching directives. Key differentiators include support for ms-formatted TTL strings (e.g., '1d', '2h'), OWASP-recommended secure caching presets, and fine-grained control via an options object. Compared to other caching middleware like `helmet` or `express-cache-headers`, it focuses solely on Cache-Control and is lightweight. Requires Node >= 18.20.8.