---
title: Variants
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

[Cache](https://developers.cloudflare.com/api/typescript/resources/cache)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Variants

##### [Get variants setting](https://developers.cloudflare.com/api/typescript/resources/cache/subresources/variants/methods/get)

client.cache.variants.get(VariantGetParams { zone\_id } params, RequestOptionsoptions?): [VariantGetResponse](https://developers.cloudflare.com/api/typescript/resources/cache#%28resource%29%20cache.variants%20%3E%20%28model%29%20variant%5Fget%5Fresponse%20%3E%20%28schema%29) { id, editable, value, modified\_on } 

GET/zones/{zone\_id}/cache/variants

##### [Change variants setting](https://developers.cloudflare.com/api/typescript/resources/cache/subresources/variants/methods/edit)

client.cache.variants.edit(VariantEditParams { zone\_id, value } params, RequestOptionsoptions?): [VariantEditResponse](https://developers.cloudflare.com/api/typescript/resources/cache#%28resource%29%20cache.variants%20%3E%20%28model%29%20variant%5Fedit%5Fresponse%20%3E%20%28schema%29) { id, editable, value, modified\_on } 

PATCH/zones/{zone\_id}/cache/variants

##### [Delete variants setting](https://developers.cloudflare.com/api/typescript/resources/cache/subresources/variants/methods/delete)

client.cache.variants.delete(VariantDeleteParams { zone\_id } params, RequestOptionsoptions?): [VariantDeleteResponse](https://developers.cloudflare.com/api/typescript/resources/cache#%28resource%29%20cache.variants%20%3E%20%28model%29%20variant%5Fdelete%5Fresponse%20%3E%20%28schema%29) { 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