---
title: "Update per-site full-page cache and APCu object cache settings"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.hostedez.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Hosted EZ REST API

`PATCH /v1/sites/{siteId}/cache`

## Authentication

- `sessionCookie`, apiKey, in cookie

## Path parameters

- `updateSiteCache.path.siteId` (string, required) — Site slug (sit_...) or UUID.

## Request body

_Required._

- `updateSiteCache.objectCacheEnabled` (boolean, optional)
- `updateSiteCache.pageCacheEnabled` (boolean, optional)

## Example request

```json
{
  "objectCacheEnabled": true,
  "pageCacheEnabled": true
}
```

## Code samples

### cURL

```curl
curl --request PATCH \
  --url https://api.hostedez.com/v1/sites/string/cache \
  --header 'Content-Type: application/json' \
  --header '__Secure-better-auth.session_token: <value>' \
  --data '
{
  "objectCacheEnabled": true,
  "pageCacheEnabled": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.hostedez.com/v1/sites/string/cache';
const options = {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    '__Secure-better-auth.session_token': '<value>'
  },
  body: JSON.stringify({objectCacheEnabled: true, pageCacheEnabled: true})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.hostedez.com/v1/sites/string/cache"

payload = {
    "objectCacheEnabled": True,
    "pageCacheEnabled": True
}
headers = {
    "Content-Type": "application/json",
    "__Secure-better-auth.session_token": "<value>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated performance and CDN status

#### Example

```json
{
  "app": "string",
  "cache": {
    "brotliEnabled": true,
    "cacheBytes": 0,
    "cachedPages": 0,
    "http2Enabled": true,
    "lastPurgedAt": "2019-08-24T14:15:22Z",
    "objectCacheEnabled": true,
    "opcacheEnabled": true,
    "pageCacheEnabled": true,
    "wpCronSystemd": true
  },
  "cdn": {
    "addonCode": "string",
    "addonMonthlyCents": 0,
    "bypassCookies": [
      "string"
    ],
    "cacheEnabled": true,
    "cdnHostname": "string",
    "distributionId": "string",
    "eligible": true,
    "enabled": true,
    "entitlementSource": "pro_plan",
    "error": "string",
    "originHost": "string",
    "status": "off"
  },
  "limits": {
    "cpuQuotaPercent": 0,
    "egressRateMbps": 0,
    "memoryMaxBytes": 0,
    "opcacheMemoryBytes": 0,
    "phpMaxChildren": 0,
    "uploadMaxBytes": 0
  },
  "siteId": "string"
}
```

- `updateSiteCache.response.200.app` (string, required)
- `updateSiteCache.response.200.cache` (object, required)
  - `updateSiteCache.response.200.cache.brotliEnabled` (boolean, required)
  - `updateSiteCache.response.200.cache.cacheBytes` (integer, required)
    - format `int64`
  - `updateSiteCache.response.200.cache.cachedPages` (integer, required)
    - format `int64`
  - `updateSiteCache.response.200.cache.http2Enabled` (boolean, required)
  - `updateSiteCache.response.200.cache.lastPurgedAt` (string | null, required)
    - format `date-time`
  - `updateSiteCache.response.200.cache.objectCacheEnabled` (boolean, required)
  - `updateSiteCache.response.200.cache.opcacheEnabled` (boolean, required)
  - `updateSiteCache.response.200.cache.pageCacheEnabled` (boolean, required)
  - `updateSiteCache.response.200.cache.wpCronSystemd` (boolean, required)
- `updateSiteCache.response.200.cdn` (object, required)
  - `updateSiteCache.response.200.cdn.addonCode` (string, required)
  - `updateSiteCache.response.200.cdn.addonMonthlyCents` (integer, required)
  - `updateSiteCache.response.200.cdn.bypassCookies` (array<string>, required)
  - `updateSiteCache.response.200.cdn.cacheEnabled` (boolean, required)
  - `updateSiteCache.response.200.cdn.cdnHostname` (string | null, required)
  - `updateSiteCache.response.200.cdn.distributionId` (string | null, required)
  - `updateSiteCache.response.200.cdn.eligible` (boolean, required)
  - `updateSiteCache.response.200.cdn.enabled` (boolean, required)
  - `updateSiteCache.response.200.cdn.entitlementSource` (string, required)
    - one of `"pro_plan"`, `"addon"`, `""`
  - `updateSiteCache.response.200.cdn.error` (string | null, required)
  - `updateSiteCache.response.200.cdn.originHost` (string, required)
  - `updateSiteCache.response.200.cdn.status` (string, required)
    - one of `"off"`, `"provisioning"`, `"active"`, `"disabling"`, `"error"`
- `updateSiteCache.response.200.limits` (object, required)
  - `updateSiteCache.response.200.limits.cpuQuotaPercent` (integer, required)
  - `updateSiteCache.response.200.limits.egressRateMbps` (integer, required)
  - `updateSiteCache.response.200.limits.memoryMaxBytes` (integer, required)
    - format `int64`
  - `updateSiteCache.response.200.limits.opcacheMemoryBytes` (integer, required)
    - format `int64`
  - `updateSiteCache.response.200.limits.phpMaxChildren` (integer, required)
  - `updateSiteCache.response.200.limits.uploadMaxBytes` (integer, required)
    - format `int64`
- `updateSiteCache.response.200.siteId` (string, required)

### 400

Invalid request

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `updateSiteCache.response.400.error` (object, required)
  - `updateSiteCache.response.400.error.code` (string, required)
  - `updateSiteCache.response.400.error.message` (string, required)
  - `updateSiteCache.response.400.error.issues` (array<object>, optional)
    - `updateSiteCache.response.400.error.issues.message` (string, required)
    - `updateSiteCache.response.400.error.issues.path` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `updateSiteCache.response.401.error` (object, required)
  - `updateSiteCache.response.401.error.code` (string, required)
  - `updateSiteCache.response.401.error.message` (string, required)
  - `updateSiteCache.response.401.error.issues` (array<object>, optional)
    - `updateSiteCache.response.401.error.issues.message` (string, required)
    - `updateSiteCache.response.401.error.issues.path` (string, required)

### 403

Forbidden origin

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `updateSiteCache.response.403.error` (object, required)
  - `updateSiteCache.response.403.error.code` (string, required)
  - `updateSiteCache.response.403.error.message` (string, required)
  - `updateSiteCache.response.403.error.issues` (array<object>, optional)
    - `updateSiteCache.response.403.error.issues.message` (string, required)
    - `updateSiteCache.response.403.error.issues.path` (string, required)

### 404

Site not found

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `updateSiteCache.response.404.error` (object, required)
  - `updateSiteCache.response.404.error.code` (string, required)
  - `updateSiteCache.response.404.error.message` (string, required)
  - `updateSiteCache.response.404.error.issues` (array<object>, optional)
    - `updateSiteCache.response.404.error.issues.message` (string, required)
    - `updateSiteCache.response.404.error.issues.path` (string, required)


Source: https://docs.hostedez.com/api/updateSiteCache/index.md
