Socket
Socket
Sign inDemoInstall

express-redis-cache

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-redis-cache - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

dump.rdb

2

lib/ExpressRedisCache.js

@@ -97,3 +97,3 @@ module.exports = (function () {

this.emit('disconnected', { host: this.host, port: this.port });
this.emit('message', 'OK connected to redis://' + this.client.address);
this.emit('message', 'Disconnected from redis://' + this.client.host + ':' + this.client.port);
}.bind(this));

@@ -100,0 +100,0 @@ }

@@ -23,2 +23,3 @@ module.exports = (function () {

callback(error);
domain.exit();
});

@@ -39,3 +40,4 @@

if ( ! keys.length ) {
return callback(null, []);
callback(null, []);
return domain.exit();
}

@@ -56,2 +58,3 @@

callback(null, results);
domain.exit();
}));

@@ -58,0 +61,0 @@ }));

@@ -85,2 +85,15 @@ module.exports = (function () {

// If the cache gets disconnected, call next()
/* NOTE: The disconnected event is emitted after any redis client completes it's configured max_attempts and delay throttling.
This will throw a nasty error regarding headers when this occurs along the lines of:
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader...
...but it will allow the request to be completed without blocking. Subsequent requests pass through as self.connected is false.
*/
self.on('disconnected', function () {
return next();
});
/** Cache entry name

@@ -87,0 +100,0 @@ *

@@ -11,3 +11,2 @@ /**

module.exports = function (
/* RedisClient */ client, // A Redis client
/* Function */ callback // Callback

@@ -28,3 +27,3 @@ ) {

/** Tell Redis to fetch the keys name beginning by prefix **/
client.keys(self.prefix + '*', domain.intercept(function (keys) {
self.client.keys(self.prefix + '*', domain.intercept(function (keys) {

@@ -48,3 +47,3 @@ var size = 0;

results.forEach(function (result) {
size += require('./sizeof')(result);
size += require('../sizeof')(result);
});

@@ -57,5 +56,3 @@

});
};
{
"name": "express-redis-cache",
"version": "0.5.0",
"version": "0.5.1",
"description": "A module to make Express interact with Redis (create, get, delete). You can automatically cache all your most popular routes in Redis.",

@@ -5,0 +5,0 @@ "main": "index.js",

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