Skip to content
Start here

Variants

Get variants setting
GET/zones/{zone_id}/cache/variants
Change variants setting
PATCH/zones/{zone_id}/cache/variants
Delete variants setting
DELETE/zones/{zone_id}/cache/variants
ModelsExpand Collapse
CacheVariant { id, modified_on }

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the ‘Vary: Accept’ response header. If the origin server sends ‘Vary: Accept’ but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

id: "variants"

ID of the zone setting.

modified_on: optional string

Last time this setting was modified.

formatdate-time
VariantGetResponse { id, editable, value, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: { avif, bmp, gif, 8 more }

Value of the zone setting.

avif: optional array of string

List of strings with the MIME types of all the variants that should be served for avif.

bmp: optional array of string

List of strings with the MIME types of all the variants that should be served for bmp.

gif: optional array of string

List of strings with the MIME types of all the variants that should be served for gif.

jp2: optional array of string

List of strings with the MIME types of all the variants that should be served for jp2.

jpeg: optional array of string

List of strings with the MIME types of all the variants that should be served for jpeg.

jpg: optional array of string

List of strings with the MIME types of all the variants that should be served for jpg.

jpg2: optional array of string

List of strings with the MIME types of all the variants that should be served for jpg2.

png: optional array of string

List of strings with the MIME types of all the variants that should be served for png.

tif: optional array of string

List of strings with the MIME types of all the variants that should be served for tif.

tiff: optional array of string

List of strings with the MIME types of all the variants that should be served for tiff.

webp: optional array of string

List of strings with the MIME types of all the variants that should be served for webp.

modified_on: optional string

Last time this setting was modified.

formatdate-time
VariantEditResponse { id, editable, value, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

value: { avif, bmp, gif, 8 more }

Value of the zone setting.

avif: optional array of string

List of strings with the MIME types of all the variants that should be served for avif.

bmp: optional array of string

List of strings with the MIME types of all the variants that should be served for bmp.

gif: optional array of string

List of strings with the MIME types of all the variants that should be served for gif.

jp2: optional array of string

List of strings with the MIME types of all the variants that should be served for jp2.

jpeg: optional array of string

List of strings with the MIME types of all the variants that should be served for jpeg.

jpg: optional array of string

List of strings with the MIME types of all the variants that should be served for jpg.

jpg2: optional array of string

List of strings with the MIME types of all the variants that should be served for jpg2.

png: optional array of string

List of strings with the MIME types of all the variants that should be served for png.

tif: optional array of string

List of strings with the MIME types of all the variants that should be served for tif.

tiff: optional array of string

List of strings with the MIME types of all the variants that should be served for tiff.

webp: optional array of string

List of strings with the MIME types of all the variants that should be served for webp.

modified_on: optional string

Last time this setting was modified.

formatdate-time
VariantDeleteResponse { id, editable, modified_on }
id: "variants"

The identifier of the caching setting.

editable: boolean

Whether the setting is editable.

modified_on: optional string

Last time this setting was modified.

formatdate-time