Delicious Node.js file stream cacher and HTTP cache server
Who said caching and serving cached files should be a chore?
With Cachelicious it's easier than baking a pie, and almost as delicious as eating it. Mmmmm, pie.... drool
node install cachelicious
var CacheliciousFs = require'cachelicious'fs;var fsCache = 20971520; //20MB of cachefsCachecreateReadStreamfilepath optionspipedestination1;fsCachecreateReadStreamfilepath start: 2 end: 100pipedestination2;//both will stream from the same cache :)
var CacheliciousHttp = require'cachelicious'http;var filepath = '/var/www/foo/';if '/' === requesturlreturn filepath + 'index.html';else if '/teapot' === requesturlreturn 418; //generate a 418elsefilepath += requesturl;return filepath;209715200start;
Some test assets are included in the test/assets directory.
You can also try streaming video (and you should :D), like the Big Buck Bunny - http://www.bigbuckbunny.org/index.php/download/
New BSD License
Pull requests are welcome! I'll try to merge all valuable contributions and credit the author when I do so.