ResponseCache class

A flexible response cache for Angel.

Use this to improve real and perceived response of Web applications, as well as to memoize expensive responses.

Constructors

ResponseCache({Duration timeout, bool ignoreQueryAndFragment: false})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
ignoreQueryAndFragment bool
If true (default: false), then caching of results will discard URI query parameters and fragments.
final
patterns List<Pattern>
A set of Patterns for which responses will be cached. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
timeout Duration
An optional timeout, after which a given response will be removed from the cache, and the contents refreshed.
final

Methods

close() Future
Closes all internal write-locks, and closes the cache.
handleRequest(RequestContext req, ResponseContext res) Future<bool>
Serves content from the cache, if applicable.
ifModifiedSince(RequestContext req, ResponseContext res) Future<bool>
A middleware that handles requests with an If-Modified-Since header. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
purge(String path) → void
Removes an entry from the response cache.
responseFinalizer(RequestContext req, ResponseContext res) Future<bool>
A response finalizer that saves responses to the cache.
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited