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
I think a nice feature would be to allow you to generate a "child" memcache client, similar to how bunyan does it (example). The main benefit to this would be to more easily differentiate and maintain prefix/key namespaces, for example:
varCached=require('cached');varbaseCache=cached('myApp');varuserCache=baseCache.child('user');varimageCache=baseCache.child('image');userCache.set(1234, ....);// would set `myApp:user:1234`baseCache.set('user:1234');// would also set `myApp:user:1234`
This would also be useful for setting setDefaults on the children that would extend the parent values, but allow you more fine grained control for different caches.
I'd be more than happy to take a crack at this if you think it's worthwhile pursuing.
The text was updated successfully, but these errors were encountered:
Good idea, thanks for the suggestion! We actually do something similar internally (creating child caches by country/locale). The only reason I'm a bit hesitant to add the logic to cached as it is today, is that the code base is kind of messy and hard to maintain. So I'd love to get some simplification in before adding a new feature. I'll take a crack at a cleanup this week and will update this issue afterwards.
I think a nice feature would be to allow you to generate a "child"
memcache
client, similar to howbunyan
does it (example). The main benefit to this would be to more easily differentiate and maintain prefix/key namespaces, for example:This would also be useful for setting
setDefaults
on the children that would extend the parent values, but allow you more fine grained control for different caches.I'd be more than happy to take a crack at this if you think it's worthwhile pursuing.
The text was updated successfully, but these errors were encountered: