/oniyi-cache

RFC2616 compliant http cache implementation in node.js

Primary LanguageJavaScript

NPM info

dependencies

RFC2616 compliant http cache implementation

Install

$ npm install --save oniyi-cache

Usage

var oniyiCache = require('oniyi-cache');

oniyiCache({
	storePrivate: false,
	storeNoStore: false,
	ignoreNoLastMod: false,
	requestValidators: [],
	responseValidators: [],
	hostConfig: {
		'www.npmjs.org': {
			storePrivate: true,
			storeNoStore: true
		}	
	}
});

Methods

hash(requestObject)

creates a hash string from the provided request object

addHostConfigs(config)

setHostConfigs(config)

updateHostConfigs(config)

clearHostConfigs(config)

getEvaluator(hostname, config)

Kudos

The basic concept here has been borrowed from Chris Corbyn's node-http-cache.

Changelog

0.0.5 --> added "authorization" to the exclusion list of headers for calculating the request hash

License

MIT © Benjamin Kroeger