fastboot-cluster-node-cache
v0.1.0 ember fastboot cache redis
FastBoot Cluster Node Cache
This cache for the FastBoot App Server utilizes cluster-node-cache to cache the results of rendered FastBoot pages.
To use this cache:
const FastBootAppServer = require('fastboot-app-server');
const ClusterNodeCache = require('fastboot-cluster-node-cache');
let cache = new ClusterNodeCache();
let server = new FastBootAppServer({
cache: cache,
expiration: 60 // optional, defaults to 5 min.
});
Additionally, if you would like your cache key to vary based on
information in the request (like headers), you can
provide a cacheKey(path, request)
function that takes in as
parameters the path being requested and the request object.
let cache = new ClusterNodeCache({
cacheKey(path, request) {
return `${path}_${request && request.cookies && request.cookies.chocolateChip}`;
}
});
npm i fastboot-cluster-node-cache
Metadata
- MIT
- Whatever
- Brian Gonzalez
- released 1/18/2017