## Change Cache Reserve setting `client.Cache.CacheReserve.Edit(ctx, params) (*CacheReserveEditResponse, error)` **patch** `/zones/{zone_id}/cache/cache_reserve` Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information. ### Parameters - `params CacheReserveEditParams` - `ZoneID param.Field[string]` Path param: Identifier. - `Value param.Field[CacheReserveEditParamsValue]` Body param: Value of the Cache Reserve zone setting. - `const CacheReserveEditParamsValueOn CacheReserveEditParamsValue = "on"` - `const CacheReserveEditParamsValueOff CacheReserveEditParamsValue = "off"` ### Returns - `type CacheReserveEditResponse struct{…}` - `ID CacheReserve` The identifier of the caching setting. - `const CacheReserveCacheReserve CacheReserve = "cache_reserve"` - `Editable bool` Whether the setting is editable. - `Value CacheReserveEditResponseValue` Value of the Cache Reserve zone setting. - `const CacheReserveEditResponseValueOn CacheReserveEditResponseValue = "on"` - `const CacheReserveEditResponseValueOff CacheReserveEditResponseValue = "off"` - `ModifiedOn Time` Last time this setting was modified. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/cache" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.Cache.CacheReserve.Edit(context.TODO(), cache.CacheReserveEditParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Value: cloudflare.F(cache.CacheReserveEditParamsValueOn), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.ID) } ``` #### Response ```json { "errors": [], "messages": [], "result": { "editable": true, "id": "cache_reserve", "value": "on" }, "success": true } ```