You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our app needs the ability to set a dynamic cache prefix. However, whenever I call cache.route({prefix: 'blah'}) and check what prefix is being utilized, it's always 'erc:'. How can I get cache.route to correctly set a prefix?
Thanks!
The text was updated successfully, but these errors were encountered:
I solved the issue by dynamically setting the name instead of a prefix. The fact that it doesn't seem possible to define the prefix from cache.route() appears to still be a bug, though.
var http = require('http');
var express = require('express');
var cache = require('express-redis-cache');
var app = express();
var cache = cache({
prefix: 'test-prefix'
});
app.get('/test', cache.route(), function (req, res) {
console.log('inside the test route');
return res.status(200).json({ result: 'done' });
});
http.createServer(app).listen(8080, 'localhost', function(err) {
if (err) { throw err; }
console.log('Web server listening at http://localhost:8080');
});
Our app needs the ability to set a dynamic cache prefix. However, whenever I call cache.route({prefix: 'blah'}) and check what prefix is being utilized, it's always 'erc:'. How can I get cache.route to correctly set a prefix?
Thanks!
The text was updated successfully, but these errors were encountered: