Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

sequelize-transparent-cache-memcached

2.2.3 • Public • Published

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

Install

npm i sequelize-transparent-cache-memcached

DownloadsWeekly Downloads

105

Version

2.2.3

License

CC-BY-4.0

Unpacked Size

3.5 kB

Total Files

4

Last publish

Collaborators

  • avatar