Interface: Cache

Cache

A JavaScript function cache. This is implemented by the lru-cache module on NPM, so you can simply do ejs.cache = LRU(10) to get a least-recently-used cache.

Source:

Methods

get(key) → {null|function}

Get the cached intermediate JavaScript function for a template.

If the cache does not contain the specified key, null shall be returned.

Parameters:
Name Type Description
key String

key for caching

Source:
Returns:
Type
null | function

reset()

Reset the entire cache.

Erases the entire cache. Called by module:ejs.clearCache

Source:

set(key, val)

Cache the intermediate JavaScript function for a template.

Parameters:
Name Type Description
key String

key for caching

val function

cached function

Source: