---
title: Cache
---

[Skip to content](#_top)

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

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Cache

#### CacheCache Reserve

#### resource cloudflare\_zone\_cache\_reserve

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

##### optional Expand Collapse

value?: String

Value of the Cache Reserve zone setting.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

### cloudflare\_zone\_cache\_reserve

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_zone_cache_reserve" "example_zone_cache_reserve" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  value = "on"
}
```

#### data cloudflare\_zone\_cache\_reserve

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

value: String

Value of the Cache Reserve zone setting.

[Link to this property](<#(resource)%20cache.cache_reserve%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value>)

### cloudflare\_zone\_cache\_reserve

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_zone_cache_reserve" "example_zone_cache_reserve" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### CacheSmart Tiered Cache

#### resource cloudflare\_tiered\_cache

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

value: String

Enable or disable the Smart Tiered Cache.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

### cloudflare\_tiered\_cache

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_tiered_cache" "example_tiered_cache" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  value = "on"
}
```

#### data cloudflare\_tiered\_cache

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

value: String

Value of the Smart Tiered Cache zone setting.

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value>)

### cloudflare\_tiered\_cache

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_tiered_cache" "example_tiered_cache" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### CacheVariants

#### resource cloudflare\_zone\_cache\_variants

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

<details>

<summary>

value: Attributes

Value of the zone setting.

</summary>

avif?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20avif">Link to this property</a>

bmp?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20bmp">Link to this property</a>

gif?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20gif">Link to this property</a>

jp2?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jp2">Link to this property</a>

jpeg?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpeg">Link to this property</a>

jpg?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpg">Link to this property</a>

jpg2?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpg2">Link to this property</a>

png?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20png">Link to this property</a>

tif?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20tif">Link to this property</a>

tiff?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20tiff">Link to this property</a>

webp?: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20webp">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

### cloudflare\_zone\_cache\_variants

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_zone_cache_variants" "example_zone_cache_variants" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  value = {
    avif = ["image/webp", "image/jpeg"]
    bmp = ["image/webp", "image/jpeg"]
    gif = ["image/webp", "image/jpeg"]
    jp2 = ["image/webp", "image/avif"]
    jpeg = ["image/webp", "image/avif"]
    jpg = ["image/webp", "image/avif"]
    jpg2 = ["image/webp", "image/avif"]
    png = ["image/webp", "image/avif"]
    tif = ["image/webp", "image/avif"]
    tiff = ["image/webp", "image/avif"]
    webp = ["image/jpeg", "image/avif"]
  }
}
```

#### data cloudflare\_zone\_cache\_variants

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

<details>

<summary>

value: Attributes

Value of the zone setting.

</summary>

avif: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20avif">Link to this property</a>

bmp: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20bmp">Link to this property</a>

gif: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20gif">Link to this property</a>

jp2: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jp2">Link to this property</a>

jpeg: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpeg">Link to this property</a>

jpg: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpg">Link to this property</a>

jpg2: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20jpg2">Link to this property</a>

png: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20png">Link to this property</a>

tif: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20tif">Link to this property</a>

tiff: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20tiff">Link to this property</a>

webp: List\[String]

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

<a href="#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value%20%3E%20(attribute)%20webp">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cache.variants%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value>)

### cloudflare\_zone\_cache\_variants

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_zone_cache_variants" "example_zone_cache_variants" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### CacheRegional Tiered Cache

#### resource cloudflare\_regional\_tiered\_cache

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

##### optional Expand Collapse

value?: String

Value of the Regional Tiered Cache zone setting.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20value>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

### cloudflare\_regional\_tiered\_cache

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_regional_tiered_cache" "example_regional_tiered_cache" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  value = "on"
}
```

#### data cloudflare\_regional\_tiered\_cache

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

Identifier.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

editable: Bool

Whether the setting is editable.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20editable>)

modified\_on: Time

Last time this setting was modified.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

value: String

Value of the Regional Tiered Cache zone setting.

[Link to this property](<#(resource)%20cache.regional_tiered_cache%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20value>)

### cloudflare\_regional\_tiered\_cache

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_regional_tiered_cache" "example_regional_tiered_cache" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```

#### CacheOrigin Cloud Regions

#### resource cloudflare\_origin\_cloud\_region

##### required Expand Collapse

origin\_ip: String

Origin IP address (IPv4 or IPv6). For the single PUT endpoint (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path parameter or the request will be rejected with a 400 error. For the batch PUT endpoint, this field identifies which mapping to upsert.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20origin_ip>)

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zone_id>)

region: String

Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported\_regions endpoint.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20region>)

vendor: String

Cloud vendor hosting the origin. Must be one of the supported vendors.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20vendor>)

##### computed Expand Collapse

id: String

Origin IP address (IPv4 or IPv6). For the single PUT endpoint (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path parameter or the request will be rejected with a 400 error. For the batch PUT endpoint, this field identifies which mapping to upsert.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

modified\_on: Time

Time this mapping was last modified.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20modified_on>)

### cloudflare\_origin\_cloud\_region

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_origin_cloud_region" "example_origin_cloud_region" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  origin_ip = "192.0.2.1"
  region = "us-east-1"
  vendor = "aws"
}
```

#### data cloudflare\_origin\_cloud\_region

##### required Expand Collapse

origin\_ip: String

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20origin_ip>)

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zone_id>)

##### computed Expand Collapse

id: String

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

modified\_on: Time

Time this mapping was last modified.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20modified_on>)

region: String

Cloud vendor region identifier.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20region>)

vendor: String

Cloud vendor hosting the origin.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20vendor>)

### cloudflare\_origin\_cloud\_region

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_origin_cloud_region" "example_origin_cloud_region" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  origin_ip = "192.0.2.1"
}
```

#### data cloudflare\_origin\_cloud\_regions

##### required Expand Collapse

zone\_id: String

Identifier.

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20zone_id>)

##### optional Expand Collapse

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for IPv6).

<a href="#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

origin\_ip: String

The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for IPv6).

<a href="#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20origin_ip">Link to this property</a>

region: String

Cloud vendor region identifier.

<a href="#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20region">Link to this property</a>

vendor: String

Cloud vendor hosting the origin.

<a href="#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20vendor">Link to this property</a>

modified\_on: Time

Time this mapping was last modified.

<a href="#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20modified_on">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cache.origin_cloud_regions%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_origin\_cloud\_regions

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_origin_cloud_regions" "example_origin_cloud_regions" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
```