{"_id":"koa-cache-control","_rev":"9-d21c2d3aedff255bea9139c7ad9bb6d2","name":"koa-cache-control","description":"Middleware for meddling with Cache-Control headers","dist-tags":{"latest":"2.0.0","next":"2.0.0"},"versions":{"1.0.0":{"name":"koa-cache-control","version":"1.0.0","description":"Middleware for meddling with Cache-Control headers","main":"index.js","scripts":{"test":"mocha","lint":"eslint ."},"repository":{"type":"git","url":"git+https://github.com/DaMouse404/koa-cache-control.git"},"keywords":["Koa","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/koa-cache-headers/issues"},"devDependencies":{"eslint":"^1.6.0","koa":"^1.0.0","mocha":"^2.3.2","supertest":"^1.1.0"},"dependencies":{"lodash":"^3.10.1"},"gitHead":"f61057bd861b1fac6027bbc7f3780a30585eb2d4","homepage":"https://github.com/DaMouse404/koa-cache-control#readme","_id":"koa-cache-control@1.0.0","_shasum":"80b72d9885c2a02fffd4317ad9b9ac7d6807837b","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"damouse404","email":"npm@damouse.co.uk"},"dist":{"shasum":"80b72d9885c2a02fffd4317ad9b9ac7d6807837b","tarball":"https://registry.npmjs.org/koa-cache-control/-/koa-cache-control-1.0.0.tgz","integrity":"sha512-PeUk4Khjd70/BKndqxZD1WNUyds58+R6/FDYRQO5UFBky7v05Ur76vEi7oxJuE6IdmnYSCOXnDPVRMr8yabRFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDHzeGRC4xqM2BoN0rjNsxVX8ETu3HQJcnbCmwl3DI9wIhAK4CI/Cfsy17/WzrxkOvIhtHCdr/sCUNDLZUIWFaOHYg"}]},"maintainers":[{"name":"damouse404","email":"npm@damouse.co.uk"}],"directories":{}},"2.0.0-alpha.2":{"name":"koa-cache-control","version":"2.0.0-alpha.2","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/koa-cache-control.git"},"keywords":["Koa","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/koa-cache-headers/issues"},"devDependencies":{"eslint":"^3.3.0","istanbul":"^0.4.3","koa":"^2.0.0-alpha.7","mocha":"^3.0.2","supertest":"^2.0.0"},"dependencies":{},"gitHead":"cfa6756efff1d371c68ffc300e5952b568d8049f","homepage":"https://github.com/DaMouse404/koa-cache-control#readme","_id":"koa-cache-control@2.0.0-alpha.2","_shasum":"8290c6690150d98bf414713566dbbcead45fdf50","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"damouse404","email":"npm@damouse.co.uk"},"dist":{"shasum":"8290c6690150d98bf414713566dbbcead45fdf50","tarball":"https://registry.npmjs.org/koa-cache-control/-/koa-cache-control-2.0.0-alpha.2.tgz","integrity":"sha512-hnIfdXfnkTSGfkMIBeKbRZboO6jcGetSGlRWBlFAdnhGjkNt6wavQqGjRAL399nhNwQrtQsaWTCNA+HmfV8MLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwtHX81OXjsnLIQSai3sAxD51rWy/MwTLVi6jZeWuOaAIhALil7EzDjBHHXymt+Qv4FKKbIFYywBUxpWjOSf8SACpb"}]},"maintainers":[{"name":"damouse404","email":"npm@damouse.co.uk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-cache-control-2.0.0-alpha.2.tgz_1481140768888_0.08740309672430158"},"directories":{}},"2.0.0":{"name":"koa-cache-control","version":"2.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/koa-cache-control.git"},"keywords":["Koa","cache","cache-control","no-cache"],"author":{"name":"Christopher Sidebottom"},"license":"MIT","bugs":{"url":"https://github.com/DaMouse404/koa-cache-headers/issues"},"devDependencies":{"eslint":"^3.3.0","istanbul":"^0.4.3","koa":"^2.0.0","mocha":"^3.0.2","supertest":"^2.0.0"},"dependencies":{},"gitHead":"3965a0bc6a0577789648555e69fd438088867077","homepage":"https://github.com/DaMouse404/koa-cache-control#readme","_id":"koa-cache-control@2.0.0","_shasum":"33c938d80a4453431e1da5a93b7523a87f7dd3c8","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.9.2","_npmUser":{"name":"damouse404","email":"christopher.sidebottom@bbc.co.uk"},"dist":{"shasum":"33c938d80a4453431e1da5a93b7523a87f7dd3c8","tarball":"https://registry.npmjs.org/koa-cache-control/-/koa-cache-control-2.0.0.tgz","integrity":"sha512-vyhUsLYQTbNl3mLCjdF5sC7OdAmn1iyugXak85TCZ51z71Y6SdYkVomcv5rlXLRxFA17fmyq0uEGcblowHlQ5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7v+mSc9bKEgOCCuGtUCadhq4pvixYayg2nhfLZBNJJwIhANvWhJGdV30VktbeO55cSLkC7DMXl/rnvrmA7HJD+BzX"}]},"maintainers":[{"name":"damouse404","email":"npm@damouse.co.uk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-cache-control-2.0.0.tgz_1488025086276_0.6132867934647948"},"directories":{}}},"readme":"# koa-cache-control\n\nA simple method for managing cache control headers from 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 object after the cacheControl() middleware is loaded on the request context:\n```js\napp.use(function *(next){\n    this.cacheControl = {\n        maxAge: 60\n    };\n\n    yield next;\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(function *(next){\n    this.cacheControl = {\n        maxAge: 60\n    };\n\n    try {\n        yield next;\n    } catch (err) {\n        this.cacheControl = {\n            maxAge: 5\n        };\n    }\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-19T09:12:40.414Z","created":"2015-10-07T20:08:00.910Z","1.0.0":"2015-10-07T20:08:00.910Z","2.0.0-alpha.1":"2016-12-07T19:47:18.923Z","2.0.0-alpha.2":"2016-12-07T19:59:30.690Z","2.0.0":"2017-02-25T12:18:08.182Z"},"homepage":"https://github.com/DaMouse404/koa-cache-control#readme","keywords":["Koa","cache","cache-control","no-cache"],"repository":{"type":"git","url":"git+https://github.com/DaMouse404/koa-cache-control.git"},"author":{"name":"Christopher Sidebottom"},"bugs":{"url":"https://github.com/DaMouse404/koa-cache-headers/issues"},"license":"MIT","readmeFilename":"README.md"}