Hierarchy

  • Opt

Properties

base: string

folder cache

Description

The base directory where persistent-cache will save its caches.

Defaults to the main modules directory

duration: number

expired in milliseconds

Description

The amount of milliseconds a cache entry should be valid for. If not set, cache entries are not invalidated (stay until deleted).

Defaults to undefined (infinite)

memory: boolean

Whether the cache should use memory caching or not (mirrors all cache data in the ram, saving disk I/O and increasing performance).

Defaults to true

name: string

cache instance name

Description

The name of the cache. Determines the name of the created folder where the data is stored, which is just base + name.

Defaults to cache

persist: boolean

Whether the cache should be persistent, aka if it should write its data to the disk for later use or not. Set this to false to create a memory-only cache.

Defaults to true