sequelize-transparent-cache-memcached
v2.2.3
Published
Memcached adaptor for sequelize-transparent-cache
Downloads
301
Maintainers
Readme
sequelize-transparent-cache-memcached
memcached adaptor for sequelize-transparent-cache.
Stores sequelize objects in memcached.
Example usage
const Memcached = require('memcached')
const memcached = new Memcached('localhost:11211')
const MemcachedAdaptor = require('sequelize-transparent-cache-memcached')
const memcachedAdaptor = new MemcachedAdaptor({
client: memcached,
namespace: 'model', // optional
lifetime: 60 * 60
})
Constructor arguments
| Param | Type | Required | Description |
|-------------|------------------|----------|---------------------------------------------------------------------------------|
| client
| memcached instance | yes | Configured memcached instance |
| namespace
| string | no | Prefix for all keys |
| lifetime
| integer | yes | Keys lifetime, seconds |
Storing format
Each object stored as single JSON string. Namespace delimeter is ":".
| Key | Value |
|--------------------------------------|-----------------|
| <namespace>:<modelName>:<objectId>
| {JSON string}
|
For more info see sequelize-transparent-cache