Created
January 5, 2018 17:19
-
-
Save hmpmarketing/697edc824f864657376f4f3edecb6328 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Memcached = require('memcached'); | |
var memcached = new Memcached('memcacheserver:11211'); | |
var Cache = {} | |
Cache.add = function (key, value, lifetime) { | |
memcached.set(key, value, lifetime); | |
}; | |
Cache.get = function (key) { | |
memcached.get(key, function (err, data) { | |
console.log(data); | |
}); | |
}; | |
module.exports = new Cache(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment