Variants
Variant support caches images with certain file extensions separately per
MIME type, so an origin serving webp to one client and jpeg to another
does not have them collapsed into a single cached copy.
Get
Current variant support setting for a zone.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->cache()->variants()->get('ZONE_ID');
Edit
Set the variants cached for a zone.
Keyed by file extension — avif, bmp, gif, jpeg, jpg, jpg2,
jp2, png, tif, tiff, webp — each holding the MIME types to
serve as variants of it:
$client->cache()->variants()->edit('ZONE_ID', [
'jpeg' => ['image/webp', 'image/avif'],
'png' => ['image/webp'],
]);
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. | |
value | array | Yes | Variants to cache, keyed by file extension. |
$response = $client->cache()->variants()->edit('ZONE_ID', []);
Delete
Revert variant support to its default, caching no variants.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
zoneId | string | Yes | Zone Identifier. |
$response = $client->cache()->variants()->delete('ZONE_ID');
Smart Tiered Cache
Smart Tiered Cache picks the single closest upper tier for each of a zone's lower tiers, rather than having the topology configured by hand.
Load Balancers
Load balancers distribute traffic across your origin servers to reduce response time and increase availability. A load balancer is scoped to either an account or a zone: pass exactly one of $accountId or $zoneId.

