StaticResource

A cached static file on disk (e.g. style, script, image).

Constructors

this
this(string filename)

Members

Functions

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

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