Name: catbox-disk
Owner: BBC
Description: Disk storage adapter for catbox
Created: 2018-04-22 13:48:12.0
Updated: 2018-04-22 14:06:35.0
Pushed: 2018-04-22 14:06:34.0
Homepage: null
Size: 20
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Disk storage adapter for catbox.
Lead Maintainer - Andrew Hughes
Code liberally cribbed from various other adapter examples, primarily
An example invocation:
t Hapi = require('hapi');
t Disk = require('catbox-disk');
t server = new Hapi.Server({
cache : [{
name : 'diskCache',
engine : Disk,
cachePath: '/some/existing/dir',
cleanEvery: 3600000,
partition : 'cache'
}]
cachePath
: string
required - a pre-existing path you want to store your cache files incleanEvery
: integer <default 1 hour>
optional - number of milliseconds between each cache cleanup for disk space recovery. Set to 0 to deactivate entirely..json
files with MD5 hashed filenames based off the keys to avoid encoding issues & length limits at the filesystem level.ABCD1234DEADBEEF.json
is stored in .../AB/CD/ABCD1234DEADBEEF.json
cleanEvery
interval option, which is active by default. If you never access an old cached file, it will take up drivespace until deleted, which is why this option is important. Be mindful if you deactivate it.