Skip to content
Start here

Variants

Get variants setting
cache.variants.get(VariantGetParams**kwargs) -> VariantGetResponse
GET/zones/{zone_id}/cache/variants
Change variants setting
cache.variants.edit(VariantEditParams**kwargs) -> VariantEditResponse
PATCH/zones/{zone_id}/cache/variants
Delete variants setting
cache.variants.delete(VariantDeleteParams**kwargs) -> VariantDeleteResponse
DELETE/zones/{zone_id}/cache/variants
ModelsExpand Collapse
class CacheVariant:

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: Literal["variants"]

ID of the zone setting.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantGetResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Value

Value of the zone setting.

avif: Optional[List[str]]

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

bmp: Optional[List[str]]

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

gif: Optional[List[str]]

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

jp2: Optional[List[str]]

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

jpeg: Optional[List[str]]

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

jpg: Optional[List[str]]

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

jpg2: Optional[List[str]]

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

png: Optional[List[str]]

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

tif: Optional[List[str]]

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

tiff: Optional[List[str]]

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

webp: Optional[List[str]]

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

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantEditResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

value: Value

Value of the zone setting.

avif: Optional[List[str]]

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

bmp: Optional[List[str]]

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

gif: Optional[List[str]]

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

jp2: Optional[List[str]]

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

jpeg: Optional[List[str]]

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

jpg: Optional[List[str]]

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

jpg2: Optional[List[str]]

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

png: Optional[List[str]]

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

tif: Optional[List[str]]

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

tiff: Optional[List[str]]

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

webp: Optional[List[str]]

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

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time
class VariantDeleteResponse:
id: Literal["variants"]

The identifier of the caching setting.

editable: bool

Whether the setting is editable.

modified_on: Optional[datetime]

Last time this setting was modified.

formatdate-time