hotelde/node-cache-manager-fs

Data is not cached

anchalkhandelwal opened this issue · 0 comments

I am using this with express session 'express-session-cache-manager' . My current code is:
`
var cacheManager = require('cache-manager')
var CacheManagerStore = require('express-session-cache-manager').default

var fsStore = require('cache-manager-fs');

var diskCache = cacheManager.caching({
store: fsStore,
options:
{ttl: 606024/* seconds /,
maxsize: 1000
10001000 / max size in bytes on disk */,
path:'diskcache',
preventfill:false,
}});

const sessionMiddleware = session({
store: new CacheManagerStore(diskCache),
secret: APP_SECRET,
resave: true,
saveUninitialized: true,
cookie: { maxAge: 2419200000}
})

app.use(sessionMiddleware)
`
This creates multiple cache files on each call.
What am i missing here?