think-cache-file

File cache Adapter for ThinkJS'S Cache


Keywords
think-cache-file, cache, thinkjs3, think-adapter
License
ISC
Install
npm install think-cache-file@1.1.2

Documentation

think-cache-file

Build Status Coverage Status npm

Use file to cache data

Install

npm install think-cache-file

How to Usage

edit config file src/config/adapter.js, add options:

const fileCache = require('think-cache-file');
exports.cache = {
  type: 'file',
  common: {
    timeout: 24 * 60 * 60 * 1000, // millisecond
  },
  file: {
    handle: fileCache,
    cachePath: '/home/usr/data',  // absolute path is necessarily required
    pathDepth: 1,
    gcInterval: 24 * 60 * 60 * 1000 // gc
  }
}