diff --git a/README.md b/README.md index 9040838..1882e4e 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,9 @@ app.get('/cache/:key', function(req, res, next) { redis.exists(req.params.key, function(err, exists) { if (err) return next(err); - if (exists === 1) - return redis.readStream(req.params.key).pipe(res); + if (exists) + return redis.readStream(req.params.key).pipe(res); + // Cache the remote http call for 60 seconds request.get('http://somewhere.com/' + req.params.key) .pipe(redis.writeThrough(req.params.key, 60)) diff --git a/package.json b/package.json index ea2bdbf..1e79bf4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redis-streams", - "version": "1.0.4", + "version": "1.0.5", "description": "Extends the node redis client with readStream and writeThrough functions.", "main": "index.js", "scripts": {