Skip to content
Start here

Variants

Get variants setting
client.cache.variants.get(VariantGetParams { zone_id } params, RequestOptionsoptions?): VariantGetResponse { id, editable, value, modified_on }
GET/zones/{zone_id}/cache/variants
Change variants setting
client.cache.variants.edit(VariantEditParams { zone_id, value } params, RequestOptionsoptions?): VariantEditResponse { id, editable, value, modified_on }
PATCH/zones/{zone_id}/cache/variants
Delete variants setting
client.cache.variants.delete(VariantDeleteParams { zone_id } params, RequestOptionsoptions?): VariantDeleteResponse { id, editable, modified_on }
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?: string | null

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: Value { avif, bmp, gif, 8 more }

Value of the zone setting.

avif?: Array<string>

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

bmp?: Array<string>

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

gif?: Array<string>

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

jp2?: Array<string>

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

jpeg?: Array<string>

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

jpg?: Array<string>

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

jpg2?: Array<string>

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

png?: Array<string>

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

tif?: Array<string>

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

tiff?: Array<string>

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

webp?: Array<string>

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

modified_on?: string | null

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: Value { avif, bmp, gif, 8 more }

Value of the zone setting.

avif?: Array<string>

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

bmp?: Array<string>

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

gif?: Array<string>

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

jp2?: Array<string>

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

jpeg?: Array<string>

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

jpg?: Array<string>

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

jpg2?: Array<string>

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

png?: Array<string>

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

tif?: Array<string>

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

tiff?: Array<string>

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

webp?: Array<string>

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

modified_on?: string | null

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?: string | null

Last time this setting was modified.

formatdate-time