
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
hapi-redis-output-cache
Advanced tools
Redis-backed output cache plugin for Hapi
$ npm i hapi-redis-output-cache --save
var server = new (require('hapi').Server)();
server.connection({ port: 3000 });
server.register([
{
register: require('hapi-redis-output-cache'),
options: {
host: '127.0.0.1',
staleIn: 30,
expiresIn: 60
}
}
], function (err) {
if (err) {
console.error('Failed to load plugin:', err);
}
server.start();
});
function(req, reply){ ... }
invoked on each cache write; useful for responding to cache miss eventsBy default, output caching is disabled. To enable it for a specific route, set isCacheable: true
in the route settings:
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
return reply('hello world');
},
config: {
plugins: {
'hapi-redis-output-cache': {
isCacheable: true
}
}
}
});
Output cache metadata is injected into each request and can be access via req.outputCache
:
FAQs
Redis-backed output cache plugin for Hapi
We found that hapi-redis-output-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.