Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cachelicious

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cachelicious

Delicious Node.js file stream cacher and HTTP cache server

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Cachelicious

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

Installation

npm install cachelicious

FS Cache Usage

var CacheliciousFs = require('cachelicious').fs;
var fsCache = new CacheliciousFs(20971520); //20MB of cache

fsCache.createReadStream(filepath, options).pipe(destination1);
fsCache.createReadStream(filepath, {start: 2, end: 100}).pipe(destination2);
//both will stream from the same cache :)

HTTP Server Usage

var CacheliciousHttp = require('cachelicious').http;

(new CacheliciousHttp(function  (request) {
	var filepath = '/var/www/foo/';
	if ('/' === request.url) {
		return filepath + 'index.html';
	} else if ('/teapot' === request.url) {
		return 418; //generate a 418
	} else {
		filepath += request.url;
	}
	return filepath;
}, 209715200)).start();	

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/

License

New BSD License

Contributing

Pull requests are welcome! I'll try to merge all valuable contributions and credit the author when I do so.

Keywords

FAQs

Package last updated on 09 Jun 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc