Record

write-options

Options for cache insertions and updates.

record write-options {
  max-age-ns: duration-ns,
  vary-rule: option​<string>,
  initial-age-ns: option​<duration-ns>,
  stale-while-revalidate-ns: option​<duration-ns>,
  stale-if-error-ns: option​<duration-ns>,
  surrogate-keys: option​<string>,
  length: option​<object-length>,
  sensitive-data: bool,
  extra: option​<borrow​<extra-write-options>>,
}

Fields

NameTypeDescription
max-age-nsduration-nsThe maximum age of the response before it is considered stale, in nanoseconds.
vary-ruleoption​<string>A list of header names to use when calculating variants for this response.
initial-age-nsoption​<duration-ns>The initial age of the response in nanoseconds.
stale-while-revalidate-nsoption​<duration-ns>The maximum duration after max-age during which the response may be delivered stale while being revalidated, in nanoseconds.
stale-if-error-nsoption​<duration-ns>The maximum duration after max-age during which the response may be delivered stale if synchronous revalidation produces an error.
surrogate-keysoption​<string>A list of surrogate keys that may be used to purge this response.
lengthoption​<object-length>The length of the response body.
sensitive-databoolEnable or disable PCI/HIPAA-compliant non-volatile caching.
extraoption​<borrow​<extra-write-options>>Additional options may be added in the future via this resource type.