CachedResponse()

A class that represents an ExpressJS response stored in the persistent cache. An instance of this class should be considered read-only.

Constructor

new CachedResponse()

Construct a CachedResponse from a cache entry. Project code should never need to call this.

Members

data

A reference to the data for the response, which will be a Buffer, or undefined if the response is empty.

expiration

Get the date & time when this entry would expire. If this instance represents an entry that was not found, returns undefined.

found

true if this instance represents a found entry in the cache, false if no entry was found.

headers

A reference to the headers for the response. The value is a plain JS object containing the headers in the format used by ExpressJS: keys are always lower-case, values are strings except for set-cookie, which is an array of strings.

key

Get the key used to retrieve this CachedResponse

namespace

Get the namespace used to retrieve this CachedResponse