CachedResource

A generic cached resource, for resources that change less often than they are requested (e.g. RSS feeds).

Constructors

this
this(DataVec data, string contentType)

Members

Functions

getData
DataVec getData()
Undocumented in source. Be warned that the author may not have intended to support it.
setData
void setData(DataVec data)

Update the contents.

Inherited Members

From AbstractCachedResource

compressionLevel
int compressionLevel;

Zlib compression level

getData
DataVec getData()

Get uncompressed data. The call may be expensive, result is cached (in uncompressedData).

getLastModified
SysTime getLastModified()

Return last modified time. Used for Last-Modified and If-Modified-Since headers. Called when cached data is invalidated; return value is cached. Returns current (invalidation) time by default.

cachePolicy
CachePolicy cachePolicy;

Caching policy. To be set during subclass construction.

contentType
string contentType;

MIME content type. To be set during subclass construction.

newRequest
void newRequest()

Called every time a request is done. Can be used to check if cached data expired, and invalidate() it. By default is a no-op.

invalidate
void invalidate()

Clear cached uncompressed and compressed data. An alternative to calling invalidate() from a subclass is to simply create a new class instance when data becomes stale (overhead is negligible).

getResponse
HttpResponse getResponse(HttpRequest request)

Used by application code.

Meta