ResponseCache class

A flexible response cache for Angel.

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

Constructors

ResponseCache({Duration timeout = const Duration(minutes: 10), bool ignoreQueryAndFragment = false})

Properties

hashCode int
The hash code for this object.
no setterinherited
ignoreQueryAndFragment bool
If true (default: false), then caching of results will discard URI query parameters and fragments.
final
log → Logger
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.
no setterinherited
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 nonexistent 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
A string representation of this object.
inherited

Operators

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