Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sframe/node-cache-manager-fs

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-cache-manager-fs

Node Cache Manager store for Filesystem

The Filesystem store for the node-cache-manager module.

Installation

npm install cache-manager-fs --save

Usage examples

Here are examples that demonstrate how to implement the Filesystem cache store.

Features

  • limit maximum size on disk
  • refill cache on startup (in case of application restart)

Single store

// node cachemanager
var cacheManager = require('cache-manager');
// storage for the cachemanager
var fsStore = require('cache-manager-fs');
// initialize caching on disk
var diskCache = cacheManager.caching({store: fsStore, options: {ttl: 60*60 /* seconds */, maxsize: 1000*1000*1000 /* max size in bytes on disk */, path:'diskcache', preventfill:true}});

Options

options for store initialization

options.ttl = 60; // time to life in seconds
options.path = 'cache/'; // path for cached files
options.preventfill = false; // prevent filling of the cache with the files from the cache-directory
options.fillcallback = null; // callback fired after the initial cache filling is completed
options.zip = false; // if true the cached files will be zipped to save diskspace
options.reviveBuffers = true; // if true buffers are returned from cache as buffers, not objects

Installation

npm install cache-manager-fs

Tests

To run tests:

npm test

Code Coverage

To run Coverage:

npm run coverage

License

cache-manager-fs is licensed under the MIT license.

About

Node Cache Manager store for filesystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.