DVAssetHttpPolicy class final

What a server tells caches about what it sends.

Constructors

DVAssetHttpPolicy({int? maxAge, int? sMaxAge, int? staleWhileRevalidate, List<String> immutable = const <String>[], String documents = 'no-cache', int memoryCacheBytes = 16 * 1024 * 1024, bool diskCache = true})
const

Properties

diskCache → bool
Whether a file the server has had to decode is kept on disk, beside its data, for the next client that needs it decoded.
final
documents → String
The directive a document goes out with.
final
hashCode → int
The hash code for this object.
no setterinherited
immutable → List<String>
Globs of paths that never change under their name (canvaskit/**), beyond the ones whose name is hashed.
final
maxAge → int?
Seconds a browser may keep a file whose name is not hashed without asking again. Null: it asks every time.
final
memoryCacheBytes → int
How much of its site the server keeps in memory. Zero keeps nothing.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sMaxAge → int?
Seconds a shared cache may keep one. Null: what maxAge says.
final
staleWhileRevalidate → int?
Seconds a stale one may still be served while it is revalidated.
final

Methods

cacheControl(String path, {bool protected = false}) → String
The Cache-Control for the file at path, which is protected when only an authorised caller may be sent it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
What was declared, and nothing that was not.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

parse(Object? section) → DVAssetHttpPolicy
dartvel.web.server.http. A value of the wrong kind is the default rather than an error: the manifest is read by a server in production, where refusing to start over a cache setting is worse than ignoring it.