CacheEntry

cache/CacheEntry~ CacheEntry

The cache entry is a typed container of cache data used to track the creation and expiration of cache entries.

Constructor

new CacheEntry(value, ttl)

Source:
Initializes the cache entry.
Parameters:
Name Type Description
value * The cache entry value.
ttl number The time to live in milliseconds.

Members

_created :number

Source:
The timestamp of creation of this cache entry.
Type:
  • number

_ttl :number

Source:
The time to live in milliseconds. The cache entry is considered expired after this time.
Type:
  • number

_value :*

Source:
Cache entry value.
Type:
  • *

Methods

getValue() → {*}

Source:
Returns the entry value. If entry value is type of object returns clone of that object.
Returns:
The entry value.
Type
*

isExpired() → {boolean}

Source:
Returns true if this entry has expired.
Returns:
true if this entry has expired.
Type
boolean

serialize() → {Object}

Source:
Exports this cache entry into a JSON-serializable object.
Returns:
This entry exported to a JSON-serializable object.
Type
Object