# Cache Reserve ## Get Cache Reserve setting `client.cache.cacheReserve.get(CacheReserveGetParamsparams, RequestOptionsoptions?): CacheReserveGetResponse` **get** `/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: CacheReserveGetParams` - `zone_id: string` Identifier. ### Returns - `CacheReserveGetResponse` - `id: CacheReserve` The identifier of the caching setting. - `"cache_reserve"` - `editable: boolean` Whether the setting is editable. - `value: "on" | "off"` Value of the Cache Reserve zone setting. - `"on"` - `"off"` - `modified_on?: string | null` Last time this setting was modified. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cacheReserve = await client.cache.cacheReserve.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(cacheReserve.id); ``` #### Response ```json { "errors": [], "messages": [], "result": { "editable": true, "id": "cache_reserve", "value": "off" }, "success": true } ``` ## Change Cache Reserve setting `client.cache.cacheReserve.edit(CacheReserveEditParamsparams, RequestOptionsoptions?): CacheReserveEditResponse` **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` - `zone_id: string` Path param: Identifier. - `value: "on" | "off"` Body param: Value of the Cache Reserve zone setting. - `"on"` - `"off"` ### Returns - `CacheReserveEditResponse` - `id: CacheReserve` The identifier of the caching setting. - `"cache_reserve"` - `editable: boolean` Whether the setting is editable. - `value: "on" | "off"` Value of the Cache Reserve zone setting. - `"on"` - `"off"` - `modified_on?: string | null` Last time this setting was modified. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.cache.cacheReserve.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', value: 'on', }); console.log(response.id); ``` #### Response ```json { "errors": [], "messages": [], "result": { "editable": true, "id": "cache_reserve", "value": "on" }, "success": true } ``` ## Get Cache Reserve Clear `client.cache.cacheReserve.status(CacheReserveStatusParamsparams, RequestOptionsoptions?): CacheReserveStatusResponse` **get** `/zones/{zone_id}/cache/cache_reserve_clear` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. ### Parameters - `params: CacheReserveStatusParams` - `zone_id: string` Identifier. ### Returns - `CacheReserveStatusResponse` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. - `id: CacheReserveClear` ID of the zone setting. - `"cache_reserve_clear"` - `start_ts: string` The time that the latest Cache Reserve Clear operation started. - `state: State` The current state of the Cache Reserve Clear operation. - `"In-progress"` - `"Completed"` - `end_ts?: string` The time that the latest Cache Reserve Clear operation completed. - `modified_on?: string | null` Last time this setting was modified. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.cache.cacheReserve.status({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.id); ``` #### Response ```json { "errors": [], "messages": [], "result": { "end_ts": "2023-10-02T12:00:00.12345Z", "id": "cache_reserve_clear", "start_ts": "2023-10-02T10:00:00.12345Z", "state": "Completed" }, "success": true } ``` ## Start Cache Reserve Clear `client.cache.cacheReserve.clear(CacheReserveClearParamsparams, RequestOptionsoptions?): CacheReserveClearResponse` **post** `/zones/{zone_id}/cache/cache_reserve_clear` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. ### Parameters - `params: CacheReserveClearParams` - `zone_id: string` Path param: Identifier. - `body: unknown` Body param ### Returns - `CacheReserveClearResponse` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. - `id: CacheReserveClear` ID of the zone setting. - `"cache_reserve_clear"` - `start_ts: string` The time that the latest Cache Reserve Clear operation started. - `state: State` The current state of the Cache Reserve Clear operation. - `"In-progress"` - `"Completed"` - `end_ts?: string` The time that the latest Cache Reserve Clear operation completed. - `modified_on?: string | null` Last time this setting was modified. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.cache.cacheReserve.clear({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', body: {}, }); console.log(response.id); ``` #### Response ```json { "errors": [], "messages": [], "result": { "id": "cache_reserve_clear", "start_ts": "2023-10-02T10:00:00.12345Z", "state": "In-progress" }, "success": true } ``` ## Domain Types ### Cache Reserve - `CacheReserve = "cache_reserve"` The identifier of the caching setting. - `"cache_reserve"` ### Cache Reserve Clear - `CacheReserveClear = "cache_reserve_clear"` ID of the zone setting. - `"cache_reserve_clear"` ### State - `State = "In-progress" | "Completed"` The current state of the Cache Reserve Clear operation. - `"In-progress"` - `"Completed"` ### Cache Reserve Get Response - `CacheReserveGetResponse` - `id: CacheReserve` The identifier of the caching setting. - `"cache_reserve"` - `editable: boolean` Whether the setting is editable. - `value: "on" | "off"` Value of the Cache Reserve zone setting. - `"on"` - `"off"` - `modified_on?: string | null` Last time this setting was modified. ### Cache Reserve Edit Response - `CacheReserveEditResponse` - `id: CacheReserve` The identifier of the caching setting. - `"cache_reserve"` - `editable: boolean` Whether the setting is editable. - `value: "on" | "off"` Value of the Cache Reserve zone setting. - `"on"` - `"off"` - `modified_on?: string | null` Last time this setting was modified. ### Cache Reserve Status Response - `CacheReserveStatusResponse` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. - `id: CacheReserveClear` ID of the zone setting. - `"cache_reserve_clear"` - `start_ts: string` The time that the latest Cache Reserve Clear operation started. - `state: State` The current state of the Cache Reserve Clear operation. - `"In-progress"` - `"Completed"` - `end_ts?: string` The time that the latest Cache Reserve Clear operation completed. - `modified_on?: string | null` Last time this setting was modified. ### Cache Reserve Clear Response - `CacheReserveClearResponse` You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation. - `id: CacheReserveClear` ID of the zone setting. - `"cache_reserve_clear"` - `start_ts: string` The time that the latest Cache Reserve Clear operation started. - `state: State` The current state of the Cache Reserve Clear operation. - `"In-progress"` - `"Completed"` - `end_ts?: string` The time that the latest Cache Reserve Clear operation completed. - `modified_on?: string | null` Last time this setting was modified.