{"id":20015520,"url":"https://github.com/cblage/node-cachelicious","last_synced_at":"2025-05-04T22:31:34.426Z","repository":{"id":2888304,"uuid":"3895437","full_name":"cblage/node-cachelicious","owner":"cblage","description":"Super-fast Node.js Native Webcache","archived":false,"fork":false,"pushed_at":"2013-10-28T06:20:52.000Z","size":30383,"stargazers_count":34,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-27T08:06:25.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cblage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-01T21:09:43.000Z","updated_at":"2021-07-02T17:01:23.000Z","dependencies_parsed_at":"2022-09-17T20:20:46.803Z","dependency_job_id":null,"html_url":"https://github.com/cblage/node-cachelicious","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblage%2Fnode-cachelicious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblage%2Fnode-cachelicious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblage%2Fnode-cachelicious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblage%2Fnode-cachelicious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cblage","download_url":"https://codeload.github.com/cblage/node-cachelicious/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252408263,"owners_count":21743083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T07:46:25.976Z","updated_at":"2025-05-04T22:31:33.376Z","avatar_url":"https://github.com/cblage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cachelicious\n=============\n\nWho said caching and serving cached files should be a chore? \n\nWith Cachelicious it's easier than baking a pie, and almost as delicious as eating it. Mmmmm, pie.... *drool*\n\n\nInstallation\n-----------\n\n    npm install cachelicious\n\n\nFS Cache Usage\n-----\n\n```js\nvar CacheliciousFs = require('cachelicious').fs;\nvar fsCache = new CacheliciousFs(20971520); //20MB of cache\n\nfsCache.createReadStream(filepath, options).pipe(destination1);\nfsCache.createReadStream(filepath, {start: 2, end: 100}).pipe(destination2);\n//both will stream from the same cache :)\n\n```\n\nStandalone HTTP Server Usage\n-----\n\n```js\nvar CacheliciousHttp = require('cachelicious').http;\n\n//create an HTTP cache server with 20MB to serve files from the assets directory\n(new CacheliciousHttp(20971520, __dirname + '/assets')).listen(9876);\t\n```\n\nConnect Middleware Usage\n-----\n\n```js\nvar connect = require('connect'),\n    cacheliciousConnect = require('cachelicious').connect,\n    http = require('http');\n\nvar app = connect()\n\t.use(cacheliciousConnect(__dirname + '/assets',  {maxCacheSize: 20971520}))\n\t.listen(3210);\n```\n\n\nSome test assets are included in the test/assets directory.\n\nYou can also try streaming video (and you should :D), like the Big Buck Bunny - http://www.bigbuckbunny.org/index.php/download/\n\nRanged HTTP requests are fully supported :)\n\nFast\n-----\n\n[APIB](http://code.google.com/p/apib/) results serving the 641KB file in the test assets, running on a 2011 MacBook Air i7 1.8GHz (initial status - cold cache):\n\n**Standlone HTTP server** *test/http.js*\n\n\tapib -d 30 -c 200 -K 2  http://127.0.0.1:9876/medium.jpg\n\n```\nDuration:             30.004 seconds\nAttempted requests:   53845\nSuccessful requests:  53845\nNon-200 results:      0\nConnections opened:   200\nSocket errors:        0\n\nThroughput:           1794.583 requests/second\nAverage latency:      111.210 milliseconds\nMinimum latency:      39.997 milliseconds\nMaximum latency:      243.020 milliseconds\nLatency std. dev:     12.224 milliseconds\n50% latency:          109.000 milliseconds\n90% latency:          124.159 milliseconds\n98% latency:          142.353 milliseconds\n99% latency:          148.804 milliseconds\n\nClient CPU average:    0%\nClient CPU max:        0%\nClient memory usage:    0%\n\nTotal bytes sent:      3.71 megabytes\nTotal bytes received:  33792.17 megabytes\nSend bandwidth:        0.99 megabits / second\nReceive bandwidth:     9009.99 megabits / second\n```\n\n**Cachelicious Connect Middleware** *test/connect.js*\n\t\n\tapib -d 30 -c 200 -K 2  http://127.0.0.1:3210/medium.jpg\n\n```\nDuration:             30.004 seconds\nAttempted requests:   49598\nSuccessful requests:  49598\nNon-200 results:      0\nConnections opened:   200\nSocket errors:        0\n\nThroughput:           1653.028 requests/second\nAverage latency:      120.535 milliseconds\nMinimum latency:      46.361 milliseconds\nMaximum latency:      572.141 milliseconds\nLatency std. dev:     31.452 milliseconds\n50% latency:          115.357 milliseconds\n90% latency:          137.229 milliseconds\n98% latency:          161.885 milliseconds\n99% latency:          194.394 milliseconds\n\nClient CPU average:    0%\nClient CPU max:        0%\nClient memory usage:    0%\n\nTotal bytes sent:      3.42 megabytes\nTotal bytes received:  31150.77 megabytes\nSend bandwidth:        0.91 megabits / second\nReceive bandwidth:     8305.67 megabits / second\n```\n\n**Static + Static Cache Connect Middleware** *test/connectStatic.js*\n\n\tapib -d 30 -c 200 -K 2  http://127.0.0.1:4321/medium.jpg\n\n```\nDuration:             30.004 seconds\nAttempted requests:   15000\nSuccessful requests:  15000\nNon-200 results:      0\nConnections opened:   200\nSocket errors:        0\n\nThroughput:           499.940 requests/second\nAverage latency:      398.803 milliseconds\nMinimum latency:      371.709 milliseconds\nMaximum latency:      525.252 milliseconds\nLatency std. dev:     24.629 milliseconds\n50% latency:          390.023 milliseconds\n90% latency:          431.956 milliseconds\n98% latency:          475.991 milliseconds\n99% latency:          505.020 milliseconds\n\nClient CPU average:    0%\nClient CPU max:        0%\nClient memory usage:    0%\n\nTotal bytes sent:      1.04 megabytes\nTotal bytes received:  9410.90 megabytes\nSend bandwidth:        0.28 megabits / second\nReceive bandwidth:     2509.27 megabits / second\n```\n\n\nLicense\n-----\n\n[New BSD License](https://github.com/cblage/node-cachelicious/blob/master/LICENSE) \n\n\nContributing\n------------\n\nPull requests are welcome! I'll try to merge all valuable contributions and credit the author when I do so.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcblage%2Fnode-cachelicious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcblage%2Fnode-cachelicious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcblage%2Fnode-cachelicious/lists"}