
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@seneca/entity-cache
Advanced tools
Seneca plugin providing simple id-based distributed entity caching.
This module is a plugin for the Seneca framework. It provides a data caching mechanism for Seneca data entities. Using this module will give your Seneca app a big performance boost.
The caching mechanism goes beyond simple key-based caching using memcached. In addition, a smaller "hot" cache is maintained within the Node process. Data entities are given transient version numbers, and these are used to synchronize the hot cache with memcached.
This plays nicely with multiple memcached instances, and allows Seneca apps to scale.
(See chapter 8 of my book for details, or read How key-based cache expiration works)
This module works by wrapping the data entity actions (role:entity, cmd:save, ... etc). You just need to register it:
var seneca = require('seneca')()
seneca.use('memcached-cache')
seneca.use('entity-cache')
Then just use data entities as normal. Except things will be a lot faster.
npm install seneca
npm install seneca-memcached-cache
npm install @seneca/entity-cache
You'll need the seneca-memcached-cache plugin as a dependency.
You'll also need memcached
Or... you can use redis: seneca-redis-cache.
The unit tests require a running memcached and redis.
Returns a JSON object containing the current hit/miss counts of the cache.
cmd:stats,plugin:entity-cache »No description provided.
Here's how to set the options (the values shown are the defaults):
seneca.use('entity-cache',{
prefix: '@seneca/entity-cache',
maxhot: 1111,
expires: 3600
})
Where:
cd test
mocha *.test.js --seneca.log.print
Also
cd test
memcached -vv
mongod --dbpath=db
node n1.js --seneca.log=type:plugin
node n2.js --seneca.log=type:plugin
FAQs
Versioned caching plugin for seneca
The npm package @seneca/entity-cache receives a total of 0 weekly downloads. As such, @seneca/entity-cache popularity was classified as not popular.
We found that @seneca/entity-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.