0.0.9 • Published 5 years ago

oniyi-cache v0.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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