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-ns

The maximum age of the response before it is considered stale, in nanoseconds.

This field is required.

vary-ruleoption​<string>

A list of header names to use when calculating variants for this response.

The format is a string containing header names separated by spaces.

initial-age-nsoption​<duration-ns>

The initial age of the response in nanoseconds.

If this field is not set, the default value is zero.

This age is used to determine the freshness lifetime of the response as well as to prioritize which variant to return if a subsequent lookup matches more than one vary rule

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.

If this field is not set, the default value is zero.

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.

If this field is not set, the default value is zero.

surrogate-keysoption​<string>

A list of surrogate keys that may be used to purge this response.

The format is a string containing valid surrogate keys separated by spaces.

If this field is not set, no surrogate keys will be associated with the response. This means that the response cannot be purged except via a purge-all operation.

lengthoption​<object-length>

The length of the response body.

If this field is not set, the length of the body is treated as unknown.

When possible, this field should be set so that other clients waiting to retrieve the body have enough information to synthesize a content-length even before the complete body is inserted to the cache.

sensitive-databool

Enable or disable PCI/HIPAA-compliant non-volatile caching.

See the Fastly PCI-Compliant Caching and Delivery documentation for details.

extraoption​<borrow​<extra-write-options>>

Additional options may be added in the future via this resource type.