Record
insert-options
Options for configuring the behavior of the insert function.
record insert-options {
background-fetch: bool,
if-generation-match: option<u64>,
metadata: option<string>,
time-to-live-sec: option<u32>,
mode: insert-mode,
extra: option<borrow<extra-insert-options>>,
}Fields
| Name | Type | Description |
|---|---|---|
| background-fetch | bool | If set, allows fetching from the origin to occur in the background, enabling a faster response with stale content. The cache will be updated with fresh content after the request is completed. |
| if-generation-match | option<u64> | Requests for keys will return a “generation” header specific to the version of a key. The generation header is a unique, non-serial 64-bit unsigned integer that can be used for testing against a specific KV store value. |
| metadata | option<string> | Sets an arbitrary data field which can contain up to 2000B of data. |
| time-to-live-sec | option<u32> | Sets a time for the key to expire. Deletion will take place up to 24 hours after the ttl reaches 0. |
| mode | insert-mode | Select the behavior in the case when the new key matches an existing key. |
| extra | option<borrow<extra-insert-options>> | Additional options may be added in the future via this resource type. |