A minimalist Node.js library that sets HTTP response headers to cache content for a long time (one year). Version 1.0.2 is the latest stable release, with no active development since 2016. The library sets Cache-Control: max-age=31536000 and omits Expires and Pragma headers, relying on HTTP/1.1 best practices where max-age overrides Expires. It is intended for immutable static assets. Unlike more complex caching libraries, it provides a single function with no configuration, making it ideal for simple use cases.
npm install cache-immutableNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an HTTP server that sets immutable caching headers on every response.
If you need HTTP/1.0 compatibility, consider adding Expires header manually.
Ensure you pass a proper response object from Node.js http module.
Consider using a more modern caching library or handle headers manually.
Only use for truly immutable assets; otherwise customise max-age.
Use `import cacheImmutable from 'cache-immutable'` or `const cacheImmutable = require('cache-immutable')`.Add the import statement at the top of your file.
Ensure the argument is a Node.js http.ServerResponse or compatible object.
No dependency data recorded yet.