Node.js shared memory cache
npm install node-share-memory-cache``typescript
import { ShmCache } from 'node-share-memory-cache';
const cache = new ShmCache({
name: 'CacheNameV1',
size: 1024 1024 10,
maxSize: 1024 1024 100,
});
// set cache with ttl
cache.set('key','value', 1000 60 5);
// get cache
const value = cache.get('key');
// delete key
cache.del('key');
``
5 child process , read+write, macbook pro
5 child process , read first, macbook pro
!write_only
5 child process , write first, win64 i5-12490