Record
write-options
Configuration for several functions that write to the cache:
inserttransaction-inserttransaction-insert-and-stream-backtransaction-update
Some options are only allowed for certain of these hostcalls; see the comments on the fields.
record write-options {
max-age-ns: duration-ns,
request-headers: option<borrow<request>>,
vary-rule: option<string>,
initial-age-ns: option<duration-ns>,
stale-while-revalidate-ns: option<duration-ns>,
surrogate-keys: option<string>,
length: option<object-length>,
user-metadata: option<list<u8>>,
edge-max-age-ns: option<duration-ns>,
sensitive-data: bool,
extra: option<borrow<extra-write-options>>,
}Fields
| Name | Type | Description |
|---|---|---|
| max-age-ns | duration-ns | this is a required field |
| request-headers | option<borrow<request>> | a full request handle, but used only for its headers Only allowed for non-transactional |
| vary-rule | option<string> | a list of header names separated by spaces |
| initial-age-ns | option<duration-ns> | The initial age of the object in nanoseconds (default: 0). This age is used to determine the freshness lifetime of the object as well as to prioritize which variant to return if a subsequent lookup matches more than one vary rule |
| stale-while-revalidate-ns | option<duration-ns> | |
| surrogate-keys | option<string> | a list of surrogate keys separated by spaces |
| length | option<object-length> | |
| user-metadata | option<list<u8>> | |
| edge-max-age-ns | option<duration-ns> | |
| sensitive-data | bool | |
| extra | option<borrow<extra-write-options>> | Additional options may be added in the future via this resource type. |