Use file to cache data
npm install think-cache-file
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
}
}