{"_id":"http-cache","_rev":"27-e365845b4d436d9dbe5a6208e48c295a","name":"http-cache","description":"An extensible caching interface for HTTP traffic.","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.0":{"name":"http-cache","version":"0.1.0","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\n\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* TTL Support\r\n* Purge Support\r\n\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.0","dist":{"shasum":"6efd0542a2e572d71ea455001c6fffb7548de57f","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.0.tgz","integrity":"sha512-4DHXnWaPQYozlEfw2Cv+CFBxTBoFwdDW1Tc6W3lCsSgEc0RZWak7O8kjqbC9qYPlRE+N3VrMitTyeq2qT3uIFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpIZt6Ippud/mJx7uRUsHjqZAz+NGCK8TBj3DUf3X86QIhAIzgyR3K6Rs5cVO5hO+qgceO2wzdoKmR63wwHBjahw2e"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.1":{"name":"http-cache","version":"0.1.1","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Purge Support\r\n* Add FileSystem Provider\r\n* Add Cassandra Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.1","dist":{"shasum":"3298a0dd6a0b22c23230fe28ecb6cb988dbf02f8","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.1.tgz","integrity":"sha512-znmqBtV3OkHPaW8dXCftcfexem89M3bY/1EErlzDiFaBW0yX2t1GhpypR8iVywjPk0aVR6db+BFQzGGjR1G9XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4+sOQuEk55gXk1a5tJA83ShKOk9FTqyeHaeCNTh7OqgIhAJj9w1LvgV4KhddGflm6WBCo/zgVE7YSrYj3nQKrRHTa"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.2":{"name":"http-cache","version":"0.1.2","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Purge Support (for provider-specific checks to remove stagnant objects that were not caught by programatic TTL support)\r\n* Add FileSystem Provider\r\n* Add Cassandra Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.2","dist":{"shasum":"b48747e60291e40f89cdee8a777dc2477dc10851","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.2.tgz","integrity":"sha512-76NpOJwoI4YV6Jwmc/uKYcUbg6/CkVE55M2kSYjbFDB/yvwgjd2uf2ULOvtILLwp1CKlayxz/+VOPIoA1mZvhg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdB1WlbjSYm+HezROQo0NohgOTOVmrBW7HPwXJCa6dRwIhANWWnpzM2EKfj6vwd5oWdvFoutF7igoH9TLOvx/XxMfi"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.3":{"name":"http-cache","version":"0.1.3","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\nTODO: Add specification here\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* FileSystemProvider - TODO\r\n* CassandraProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Purge Support (for provider-specific checks to remove stagnant objects that were not caught by programatic TTL support)\r\n* Add FileSystem Provider\r\n* Add Cassandra Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.3","dist":{"shasum":"f31b08ff2297e704e15bedfcdf71c278a119917b","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.3.tgz","integrity":"sha512-EaJxzo9q/fPlmNoog7xq2me/b0KBItElUACJdcmitGeijQJp735IChRMVoXbm5W1x+SdXrKPppfWEpFxuCkoOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAwt7YRRz5uYMiW8za4FngyT18g9eBpQM7fzHFYt7YIrAiBxI4qEVF2rxmyUvoi2FJKYEloypB2JcAm98Kby0g0B4w=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.4":{"name":"http-cache","version":"0.1.4","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\nTODO: Add specification here\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* FileSystemProvider - TODO\r\n* CassandraProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Purge Support (for provider-specific checks to remove stagnant objects that were not caught by programatic TTL support)\r\n* Add FileSystem Provider\r\n* Add Cassandra Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.4","dist":{"shasum":"46eada72fb95f135863bbc7f0f0edc408d2d5fc9","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.4.tgz","integrity":"sha512-A6+0PB33SwFffXX4Vu9vS4bdSnxl0MYNw6nVevmbTTvF/jzUWHMDWD+VS1yKHa0FhgzJaONSIgKkBr69o+cZ3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFPVuCCrkszdGXmBaEY4TZhr94BLblG8zZeF3SOFh9OLAiEAku3M8AFZyYPQIRk9zK15+7rjPqFSBsoFQXbGoYrWZ9o="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.5":{"name":"http-cache","version":"0.1.5","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* FileSystemProvider - TODO\r\n* CassandraProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add Cassandra Provider\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.5","dist":{"shasum":"5a948721c3309b61a8ebd95d58e8db680c20aa2e","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.5.tgz","integrity":"sha512-8ZNd6utn8tpZAXbnNh8k33s0Fbb6qiNWu2WYSMwqP5LtRwVZ6oFnRfF5/4SeH/udz0z7Db50JM9Nylf4u63Agg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEu0TlDKwT7as6JfnafgDsoXZl77Zo/1O+TNhzE6q431AiBpTWenTvJaarO4GUXkL4mLPngLGQ+hXL92bIsXMoNqkA=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.1.6":{"name":"http-cache","version":"0.1.6","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 2000"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* FileSystemProvider - TODO\r\n* CassandraProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add Cassandra Provider\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.1.6","dist":{"shasum":"6367019e998ae901fb3c1e3a184601a38f09ca24","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.1.6.tgz","integrity":"sha512-hos6G4BKu/WqLQdPNjPmL3pc342E7RPHJ7dFxP2h3suUsAoybcqtKrfV3xjQcjH1qRGUzYrJp3B0J5lMnehM9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCbEDBCSWwh0uK8XHUnwwPUvjEmWObQyQmD4yoOkT8ZQIhAL6SSPDEROhmCwhU5Aa5sXprNI9Yc1Eh24mxlaEgFSUp"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.2.0":{"name":"http-cache","version":"0.2.0","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 4000 -d"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n* confirmCacheBeforeEnd (default: false) - If set to true, will confirm successful\r\n  cache writes before ending response. Typically only used for unit tests to avoid\r\n  race conditions. Should not be used in a production setting.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\n* provider.isTTLManaged - If set to true, http-cache will not be responsible for\r\n  purging expired entries. Reserved for distributed providers that have internal\r\n  support for TTL that will be more reliable.\r\n* provider.get(key, cb) - Returns object via callback. If no object found, null or undefined\r\n  should be returned, NOT an error.\r\n* provider.set(key, cache, cb) - Stores a JavaScript object in whatever means necessary.\r\n* provider.remove(key, cb) - Removes cache entry if it exists.\r\n* provider.clear(cb) - Purges all cache entries.\r\n\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* CassandraProvider - https://npmjs.org/package/http-cache-cassandra\r\n* FileSystemProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nView code coverage in any browser:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.2.0","dist":{"shasum":"6b6709e376f21d6def942bec63970c8b80756f65","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.2.0.tgz","integrity":"sha512-dZZFqUUjxAFMwCvSwp5XygZvXU6Tyd/217IQP9SZ3HkOE4t7etHv55nXdmuExbRvPBP9llD2EklA2UF5LM3Msg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUeCpz6wkHavySRPFmdfqrV1KRTs25BV65AqBc7xlpxQIhAJP3SzukkabA9vBtB3RQT1bo3YzxsEio9DuUCt50P91Y"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.2.2":{"name":"http-cache","version":"0.2.2","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 4000 -d"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n* confirmCacheBeforeEnd (default: false) - If set to true, will confirm successful\r\n  cache writes before ending response. Typically only used for unit tests to avoid\r\n  race conditions. Should not be used in a production setting.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\n* provider.isTTLManaged - If set to true, http-cache will not be responsible for\r\n  purging expired entries. Reserved for distributed providers that have internal\r\n  support for TTL that will be more reliable.\r\n* provider.get(key, cb) - Returns object via callback. If no object found, null or undefined\r\n  should be returned, NOT an error.\r\n* provider.set(key, cache, cb) - Stores a JavaScript object in whatever means necessary.\r\n* provider.remove(key, cb) - Removes cache entry if it exists.\r\n* provider.clear(cb) - Purges all cache entries.\r\n\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* CassandraProvider - https://npmjs.org/package/http-cache-cassandra\r\n* FileSystemProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nView code coverage in any browser:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.2.2","dist":{"shasum":"4990cd99b3fe4ac2595fc288061618a8e71f9ab4","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.2.2.tgz","integrity":"sha512-ewkE/7+kxfqJDz4SwAyRyaG0gVQLVC7WDGNACUrULzkMmJLwQTbrrPDXs0bBKYwSkku0sWcSTgZbkWsv1+27FQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERJLk5UEsdbrNMb2MAflEVkReH2XoL4WzztK+cpgWwJAiApG131Jg6tETMVYSgKEEM9LuXlA1Cg8JytsH5v0Q+v8g=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.3.0":{"name":"http-cache","version":"0.3.0","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 4000 -d"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* varyByHeader (default: []) - An array of strings that will cache key by specific\r\n  header fields.\r\n* varyByParam (default: []) - An array of strings that will cache key by specific\r\n  querystring parameters.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n  Typically only useful during testing.\r\n* confirmCacheBeforeEnd (default: false) - If set to true, will confirm successful\r\n  cache writes before ending response. Typically only used for unit tests to avoid\r\n  race conditions. Should not be used in a production setting.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\n* provider.isTTLManaged - If set to true, http-cache will not be responsible for\r\n  purging expired entries. Reserved for distributed providers that have internal\r\n  support for TTL that will be more reliable.\r\n* provider.get(key, cb) - Returns object via callback. If no object found, null or undefined\r\n  should be returned, NOT an error.\r\n* provider.set(key, cache, cb) - Stores a JavaScript object in whatever means necessary.\r\n* provider.remove(key, cb) - Removes cache entry if it exists.\r\n* provider.clear(cb) - Purges all cache entries.\r\n\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* CassandraProvider - https://npmjs.org/package/http-cache-cassandra\r\n* FileSystemProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\nDownload and install:\r\n\r\n\tgit clone https://github.com/godaddy/node-http-cache.git\r\n\tcd node-http-cache\r\n\tnpm install\r\n\r\nNow test:\t\r\n\r\n\tnpm test\r\n\r\nView code coverage in any browser:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add varyByParam array option\r\n* Add varyByHeader array option\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.3.0","dist":{"shasum":"59c0281efcb5e5887df6284a56f2bb1acf1ababb","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.3.0.tgz","integrity":"sha512-FZA6GQSGKJ9NV692wqtnbzmEqAvgrJap8RB+2of5mJ2tKckVH9XFpJZnoj5dlloMQ8B9y8lOPw3byC83TumhAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyveatgXfspw4BdbzrN6PdvbWv+zoGGeBaK0aNqPj6zAIgUvIt3wPySycWM/en5F/nRICam+vbeGt2CD6wtr68iz8="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]},"0.3.1":{"name":"http-cache","version":"0.3.1","author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"description":"An extensible caching interface for HTTP traffic.","scripts":{"test":"istanbul cover ./node_modules/mocha/bin/_mocha -- --ui bdd -R spec -t 4000 -d"},"dependencies":{"async":">=0.2.x","extend":">=1.1.x"},"devDependencies":{"mocha":"~1.12.0","istanbul":"~0.1.43","connect":">=2.7.x","request":">=2.21.0"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"license":"MIT","homepage":"https://github.com/godaddy/node-http-cache","bugs":{"url":"https://github.com/godaddy/node-http-cache/issues"},"keywords":["http","REST","cache","http cache"],"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\nA simple HTTP caching interface with extensible provider support.\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## HttpCache Options\r\n\r\nOptions may be provided when constructing your HttpCache object...\r\n\r\n\tvar HttpCache = require(\"http-cache\");\r\n\tvar httpcache = new HttpCache({ /* my options go here */ });\r\n\t\r\nOptions include:\r\n\r\n* ttl (default: 600) - Time (in seconds) before cache object will be purged.\r\n* provider (default: require(\"lib/providers/InProcProvider\")) - Alternate providers may\r\n  be specified, including your own Custom Provider.\r\n* headersToExclude (default: see code) - You may optionally manage which HTTP headers\r\n  are included/excluded via this object.\r\n* rules (default: []) - An optional set of custom caching rules. See Custom Rules.\r\n* varyByHeader (default: []) - An array of strings that will cache key by specific\r\n  header fields.\r\n* varyByParam (default: []) - An array of strings that will cache key by specific\r\n  querystring parameters.\r\n* purgeAll (default: false) - If true, will clear all cache objects from the provider.\r\n  Typically only useful during testing.\r\n* confirmCacheBeforeEnd (default: false) - If set to true, will confirm successful\r\n  cache writes before ending response. Typically only used for unit tests to avoid\r\n  race conditions. Should not be used in a production setting.\r\n\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\t\r\n## Custom Provider\r\n\t\r\nProviders are intended to be very simple and extensible, so feel free to contribute\r\nyour own providers if what is provided does not suite your needs.\r\n\r\n* provider.isTTLManaged - If set to true, http-cache will not be responsible for\r\n  purging expired entries. Reserved for distributed providers that have internal\r\n  support for TTL that will be more reliable.\r\n* provider.get(key, cb) - Returns object via callback. If no object found, null or undefined\r\n  should be returned, NOT an error.\r\n* provider.set(key, cache, cb) - Stores a JavaScript object in whatever means necessary.\r\n* provider.remove(key, cb) - Removes cache entry if it exists.\r\n* provider.clear(cb) - Purges all cache entries.\r\n\r\n\r\nSee lib/providers/in-proc-provider.js to see how to create your own provider.\r\n\r\n\r\n\r\n## Available Providers\r\n\r\nIf you build your own custom provider, feel free to issue a pull request so we can reference\r\nyour provider as well.\r\n\r\n* InProcProvider - https://github.com/godaddy/node-http-cache/blob/master/lib/providers/in-proc-provider.js\r\n* CassandraProvider - https://npmjs.org/package/http-cache-cassandra\r\n* FileSystemProvider - TODO\r\n\t\r\n\r\n## Tests & Code Coverage\r\n\r\nDownload and install:\r\n\r\n\tgit clone https://github.com/godaddy/node-http-cache.git\r\n\tcd node-http-cache\r\n\tnpm install\r\n\r\nNow test:\t\r\n\r\n\tnpm test\r\n\r\nView code coverage in any browser:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* Add FileSystem Provider\r\n* Add sliding TTL support? (Possible performance impact)\r\n* Add per-request TTL customization? (Possible performance impact)\r\n* Add support for array based header values (part of node spec), i.e.\r\n\t* res.writeHead(200, { \"set-cookie\": [cookie1, cookie2] });\r\n","readmeFilename":"README.md","_id":"http-cache@0.3.1","dist":{"shasum":"10589e6555f8f85b73f660ca6511bce27ef27e92","tarball":"https://registry.npmjs.org/http-cache/-/http-cache-0.3.1.tgz","integrity":"sha512-vEtu0hWEc6m4/RvMfXjHMcIj3/2LOswrC0la+O/5i73m/0fThgruh5VlGPEK/Y1XwSdEiNFLdh2tY5N+HdtOhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJwxhBPG0yUvRAP3lx5uVydwLHYG2hN4dpQ/rVC5PaoQIhAKPYJUl2DzphmyyHtdggnnIaozZ3rH37i7/1I13WVctZ"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"asilvas","email":"asilvas@godaddy.com"},"maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}]}},"readme":"# http-cache\r\n\r\n[![Build Status](https://travis-ci.org/godaddy/node-http-cache.png)](https://travis-ci.org/godaddy/node-http-cache) [![NPM version](https://badge.fury.io/js/http-cache.png)](http://badge.fury.io/js/http-cache) [![Dependency Status](https://gemnasium.com/godaddy/node-http-cache.png)](https://gemnasium.com/godaddy/node-http-cache)\r\n\r\n\r\n## Install\r\n\r\n\tnpm install http-cache\r\n\r\nhttps://npmjs.org/package/http-cache\r\n\r\n\r\n## What is it?\r\n\r\n\r\n\r\n \r\n## Getting Started with Connect/Express\r\n\r\nUsing Connect or Express?\r\n\r\n\tvar\r\n\t\tconnect = require(\"connect\"),\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar app = connect()\r\n\t\t.use(new HttpCache({ }))\r\n\t\t.use(function(req, res) {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\r\n\thttp.createServer(app).listen(8392);\r\n\r\n\t\r\n## Getting Started with HTTP\r\n\r\nReal coders use no middleware? We've got you covered...\r\n\r\n\tvar\r\n\t\thttp = require(\"http\"),\r\n\t\tHttpCache = require(\"http-cache\")\r\n\t;\r\n\r\n\tvar httpcache = new HttpCache({ });\r\n\thttp.createServer(function(req, res) {\r\n\t\thttpcache(req, res, function() {\r\n\t\t\tres.end(\"Cache this response! Time=\" + new Date().getTime());\r\n\t\t});\r\n\t}).listen(8392);\r\n\t\r\n\t\r\n## Custom Rules\r\n\r\nBoth synchronous and asynchronous rules may be provided:\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res) {\r\n\t\t\t// do not cache users folder\r\n\t\t\treturn (/\\/users\\//i.test(req.url) === false);\r\n\t\t}\r\n\t});\r\n\r\nAsync rules leverage cb instead of returning...\r\n\r\n\thttpcache({\r\n\t\trules: function(req, res, cb) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\t// do not cache users folder\r\n\t\t\t\tcb(null, /\\/users\\//i.test(req.url) === false);\r\n\t\t\t}, 100);\r\n\t\t}\r\n\t});\r\n\t\r\nMultiple rules may be provided as well... (will be processed in parallel)\r\n\r\n\thttpcache({\r\n\t\trules: [ rule1, rule2, rule3 ]\r\n\t});\r\n\r\n\r\n## Tests & Code Coverage\r\n\r\n\tnpm test\r\n\r\nNow you can view coverage using any browser here:\r\n\r\n\tcoverage/lcov-report/index.html\r\n\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/godaddy/node-http-cache/blob/master/LICENSE.txt)\r\n\r\n\r\n\r\n## TODO\r\n\r\n* TTL Support\r\n* Purge Support\r\n\r\n","maintainers":[{"name":"asilvas","email":"asilvas@godaddy.com"}],"time":{"modified":"2022-06-18T22:09:41.706Z","created":"2013-11-01T21:15:42.967Z","0.1.0":"2013-11-01T21:15:45.699Z","0.1.1":"2013-11-01T22:49:51.541Z","0.1.2":"2013-11-01T22:57:00.562Z","0.1.3":"2013-11-01T23:04:41.983Z","0.1.4":"2013-11-01T23:19:09.799Z","0.1.5":"2013-11-04T20:37:18.152Z","0.1.6":"2013-11-05T15:49:02.569Z","0.2.0":"2013-11-06T15:52:34.228Z","0.2.2":"2013-11-06T17:34:44.861Z","0.3.0":"2013-11-07T16:18:28.596Z","0.3.1":"2013-11-07T16:26:33.959Z"},"author":{"name":"Aaron Silvas","email":"asilvas@godaddy.com"},"repository":{"type":"git","url":"https://github.com/godaddy/node-http-cache.git"},"users":{"acarlos1000":true,"sbrajesh":true}}