{"_id":"express-cache-controller","_rev":"9-fd716b434db82e899a9a3ee9937f84d8","name":"express-cache-controller","description":"Middleware for meddling with Cache-Control headers","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"express-cache-controller","version":"1.0.0","description":"Middleware for meddling with Cache-Control headers","main":"index.js","scripts":{"test":"mocha","lint":"eslint .","coverage":"istanbul cover _mocha -- -R dot"},"repository":{"type":"git","url":"git+https://github.com/DaMouse404/express-cache-controller.git"},"keywords":["express","max-age","maxage","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/express-cache-controller/issues"},"devDependencies":{"eslint":"^2.10.2","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^2.3.2","supertest":"^1.1.0"},"dependencies":{"lodash.isnumber":"^3.0.3","on-headers":"^1.0.1"},"gitHead":"ef25797f49b45f20688dc1103399cf136d6ea7bf","homepage":"https://github.com/DaMouse404/express-cache-controller#readme","_id":"express-cache-controller@1.0.0","_shasum":"cfbce643d497cadbd6c9ec5ee85456bdcf6a9694","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.4.3","_npmUser":{"name":"tviplayer","email":"chris.sidebottom@bbc.co.uk"},"dist":{"shasum":"cfbce643d497cadbd6c9ec5ee85456bdcf6a9694","tarball":"https://registry.npmjs.org/express-cache-controller/-/express-cache-controller-1.0.0.tgz","integrity":"sha512-cs6gVLTa/FSxE16ce/eslsRnjmu74JKffCxZ5XeMbKJ4o6Mu57eXsY9FB4Ci3MBBamwlBPQWJ4AzeMPj8sVuzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDe1S0E3zyY33KqXuncxtbAbosMnO9DTQ+wp8OEien9wAiEAmE18v5k20Hxl8zsLEeCwGjdnEZZ0HlXmLXS4IHPSlSs="}]},"maintainers":[{"name":"tviplayer","email":"chris.sidebottom@bbc.co.uk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/express-cache-controller-1.0.0.tgz_1463846771381_0.1249089352786541"}},"1.0.1":{"name":"express-cache-controller","version":"1.0.1","description":"Middleware for meddling with Cache-Control headers","main":"index.js","scripts":{"test":"mocha","lint":"eslint .","coverage":"istanbul cover _mocha -- -R dot"},"repository":{"type":"git","url":"git+https://github.com/DaMouse404/express-cache-controller.git"},"keywords":["express","max-age","maxage","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/express-cache-controller/issues"},"devDependencies":{"eslint":"^2.10.2","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^2.5.1","supertest":"^1.1.0"},"dependencies":{"lodash.isnumber":"^3.0.3","on-headers":"^1.0.1"},"gitHead":"84b093eb87fe39f6e822c498343498a79592aa4b","homepage":"https://github.com/DaMouse404/express-cache-controller#readme","_id":"express-cache-controller@1.0.1","_shasum":"0076c0dfe2895e2e07ebef1f6694c668ce3f2514","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.4.3","_npmUser":{"name":"damouse404","email":"npm@damouse.co.uk"},"dist":{"shasum":"0076c0dfe2895e2e07ebef1f6694c668ce3f2514","tarball":"https://registry.npmjs.org/express-cache-controller/-/express-cache-controller-1.0.1.tgz","integrity":"sha512-LS0EMEW6lZGIESMaO0ssLDY4TpjJHPdlDg4EMa0NkuZC9/YJDggk55KVcML9kAYxMXUTIqKMJrM2IYH3o8cb8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5PS/6AKhG5IE+NbTgh0uqPBxmgNWuPe0YLRop6L6hIQIgZ8nnGRsmVltc8kGMItjQ4/X9h9cNadcRc0o6Dxg+ft0="}]},"maintainers":[{"name":"damouse404","email":"npm@damouse.co.uk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/express-cache-controller-1.0.1.tgz_1464006716698_0.8580684601329267"}},"1.1.0":{"name":"express-cache-controller","version":"1.1.0","description":"Middleware for meddling with Cache-Control headers","main":"index.js","scripts":{"test":"mocha","lint":"eslint .","coverage":"istanbul cover _mocha -- -R dot"},"repository":{"type":"git","url":"git+https://github.com/DaMouse404/express-cache-controller.git"},"keywords":["express","max-age","maxage","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/express-cache-controller/issues"},"devDependencies":{"eslint":"^3.1.1","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^3.0.2","supertest":"^2.0.0"},"dependencies":{"lodash.isnumber":"^3.0.3","on-headers":"^1.0.1"},"gitHead":"ceca47ba35019b9012f3d553ed8dcdb9286f7ec8","homepage":"https://github.com/DaMouse404/express-cache-controller#readme","_id":"express-cache-controller@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"6.11.0","_npmUser":{"name":"damouse404","email":"chris.sidebottom@bbc.co.uk"},"dist":{"integrity":"sha512-aRGah9AdVUqyChcFjbL03SVW0c6siE871wzMRuXxCONzYiBDmUtGFEnzZP1ABM6nCo3ovnKPntFRFzAxGqmWtw==","shasum":"fa8f02e0ec40374ce552522526b6aab883c76048","tarball":"https://registry.npmjs.org/express-cache-controller/-/express-cache-controller-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNjCbSqA16ILqIH+SW+SGhq0Mq7md86upFfF7kC/blNAIhAO7eUFPnlzwXoMXWc4Q5ZkCaNmBttEC7MhhtspT2HR3c"}]},"maintainers":[{"email":"chris.sidebottom@bbc.co.uk","name":"damouse404"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-cache-controller-1.1.0.tgz_1509371121026_0.4394670957699418"}}},"readme":"# express-cache-controller\n\nA simple and lightweight module for managing cache control headers from within your application. It also tries to provide a simple set of rules for common use cases such as setting 'max-age=0' when 'no-cache' is present by default.\n\n## Example\nConfiguring noCache easily:\n```js\napp.use(cacheControl({\n  noCache: true\n}));\n```\nCreates a cache-control header of `no-cache, max-age=0`\n\n## Usage\nTo start using cacheControl, just use the middleware in your application:\n```js\napp.use(cacheControl());\n```\n\n### Default Cache Headers\nWhen initialising the middleware you can set default options when you use it in your application:\n```js\napp.use(cacheControl({\n    maxAge: 5\n}));\n```\n\n### Overriding Defaults\nJust set the cacheControl property of the response object after the cacheControl() middleware is loaded:\n```js\napp.use(cacheControl({ maxAge: 60 }));\napp.get('/', function (req, res, next){\n  res.cacheControl = {\n      maxAge: 30\n  };\n\n  res.send('hai');\n});\n```\n\nThis is useful in error conditions where you can setup cache headers before and after a request is processed:\n```js\napp.use(cacheControl({ maxAge: 60} ));\napp.get('/', function (req, res, next) {\n  next(Error('BOOM!'));\n});\napp.use(function (err, req, res, next) {\n  res.cacheControl = {\n      maxAge: 5\n  };\n\n  res.status(500).send('oh no!');\n});\n```\n\n## Options\nName | Value | Description\n----|----|---\nprivate | Boolean | Adds 'private' flag, overrides 'public' option\npublic | Boolean | Adds 'public' flag\nnoStore | Boolean | Adds 'no-store' flag and includes noCache\nnoCache | Boolean | Adds 'no-cache' flag, sets maxAge to 0 and removes sMaxAge, staleIfError and staleWhileRevalidate\nnoTransform | Boolean | Adds 'no-transform' flag\nmustRevalidate | Boolean | Adds 'must-revalidate' flag and removes staleIfError and staleWhileRevalidate\nstaleIfError | Number | Adds 'stale-if-error=%d' flag\nstaleWhileRevalidate | Number | Adds 'stale-while-revalidate=%d' flag\nmaxAge | Number | Adds 'max-age=%d' flag\nsMaxAge | Number | Adds 's-maxage=%d' flag\n","maintainers":[{"email":"chris.sidebottom@bbc.co.uk","name":"damouse404"}],"time":{"modified":"2022-06-17T22:11:23.844Z","created":"2016-05-21T16:06:12.470Z","1.0.0":"2016-05-21T16:06:12.470Z","1.0.1":"2016-05-23T12:31:58.847Z","1.1.0":"2017-10-30T13:45:21.853Z"},"homepage":"https://github.com/DaMouse404/express-cache-controller#readme","keywords":["express","max-age","maxage","cache","cache-control","no-cache"],"repository":{"type":"git","url":"git+https://github.com/DaMouse404/express-cache-controller.git"},"author":{"name":"Christopher Sidebottom"},"bugs":{"url":"https://github.com/DaMouse404/express-cache-controller/issues"},"license":"MIT","readmeFilename":"README.md"}