BryanDonovan/node-cache-manager 701
Cache module for Node.JS
BryanDonovan/digital-dice-book-solutions 4
Assorted solutions to the book Digital Dice by Paul J. Nahin
an Active Record plugin that makes it easier to work with the money gem
BryanDonovan/node-couchbase-example 2
Example Node.js application using Couchbase via couchnode npm.
Simple, yet powerful wrapper for taf2's curb (libcurl) library
Mocking NodeJS Modules
Simplifying the use of mocks with Node.js
AutomateIt is an open source tool for automating the setup and maintenance of servers, applications and their dependencies.
libcouchbase node.js access
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
No problem!
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
I left get to simply retrieve from cache and not do any implicit updates. I could see the case to have it do an update as well, but that's really what wrap is for.
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
Yeah, it should get set in the local cache for B. This test demonstrates that: https://github.com/BryanDonovan/node-cache-manager/blob/master/test/multi_caching.unit.js#L1693
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
Hmm... actually, are you sure using 0 for ttl is not working? This example seems to work for me:
const cacheManager = require('cache-manager');
const memoryCache = cacheManager.caching({store: 'memory', max: 100, ttl: 0});
function getUser(id, cb) {
setTimeout(() => {
console.log("Fetching user from slow database.");
cb(null, {id: id, name: 'Bob'});
}, 100);
}
const userId = 123;
function getCachedUser(id, cb) {
memoryCache.wrap(id, cacheCallback => {
getUser(id, cacheCallback);
}, cb);
}
getCachedUser(userId, (err, user) => {
// First time fetches the user from the (fake) database:
console.log('Fetched user:', user);
setTimeout(() => {
getCachedUser(userId, (err, user) => {
// Second time fetches from cache.
console.log('Fetched user:', user);
process.exit();
});
}, 1010);
});
The output is:
Fetching user from slow database.
Fetched user: { id: 123, name: 'Bob' }
Fetched user: { id: 123, name: 'Bob' }
(which shows that it's only fetching from the "database" once).
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
How would noTtl work with lru-cache?
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
The problem is that I can't arbitrarily decide that a ttl of zero means infinite for all stores. All we can do is pass it to the underlying store. I didn't want to define the behavior of passing zero to lru-cache because they could change how it works and then cache-manager's docs would be wrong. Still, I could clarify the docs.. I'll do that when I have a bit of spare time.
comment created time in a month
issue commentBryanDonovan/node-cache-manager
No uniform way of defining an inifinite ttl
Sorry, I can't do anything about how the underlying stores work..
comment created time in a month
issue commentBryanDonovan/node-cache-manager
How to disable cache in development?
Oh, cool. I think someone else bumped it for a security reason. Glad it's faster too..
comment created time in a month
issue commentBryanDonovan/node-cache-manager
How to disable cache in development?
Sorry for the delayed response. Yeah, what @curtdept said. You basically have to manually turn cache on or off. Also, a ttl of 0 results in there being no ttl at all.
comment created time in a month
pull request commentBryanDonovan/node-cache-manager
This is in version 3.4.0
comment created time in 2 months
push eventBryanDonovan/node-cache-manager
commit sha 9bc3481dda756aa95a3f018be263f0639826c4e1
Merge branch 'release/3.3.0' into develop
commit sha eba9311872eb13434a9a300ac6c2a7206883ecc3
Update dependencies
commit sha 263a9977536a23fe9172459d6209c82561a2a60b
Merge pull request #145 from orgads/update-deps Update dependencies
commit sha 924cb79391b01e381c0f96924c43f357b6a45a49
3.4.0
commit sha 00e688c5b1de6e88446f6bc800b04094b2c7ebba
Merge branch 'release/3.4.0'
push time in 2 months
push eventBryanDonovan/node-cache-manager
commit sha 924cb79391b01e381c0f96924c43f357b6a45a49
3.4.0
commit sha 72369aa736677f0e18eca9b553d9cb3d56fbb8c0
Merge branch 'release/3.4.0' into develop
push time in 2 months
push eventBryanDonovan/node-cache-manager
commit sha 141858e719914d0a982c8ae5faba830283b09c68
Merge branch 'release/3.1.0'
commit sha 47394382c265de9f845993483519211d25f59a3d
Merge branch 'release/3.2.0'
commit sha 227fb2119e5e124ab9e6895beac13cbe11bccbf5
Merge branch 'release/3.2.1'
commit sha 8874b2927f28e59c31d5a1d96e0dee07236f5e68
Merge branch 'release/3.3.0'
commit sha eba9311872eb13434a9a300ac6c2a7206883ecc3
Update dependencies
commit sha 263a9977536a23fe9172459d6209c82561a2a60b
Merge pull request #145 from orgads/update-deps Update dependencies
push time in 2 months
pull request commentBryanDonovan/node-cache-manager
Sorry, I've been on vacation. I'll try to get to this today.
comment created time in 2 months