Skip to content

Cache

Introduction

The Cache API provides endpoints to purge various caches for a specific box. This includes clearing the standard WordPress cache, OPcache, and Varnish cache. All endpoints require JWT authentication.


Clear all caches

Purge the standard WordPress cache for a specific box.

Endpoint

DELETE /v1/boxes/{id}/cache

Request Parameters

Parameter Location Type Required Description
id Path string Yes The ID of the box
Authorization Header string Yes Bearer token (JWT)

Responses

Success Response

  • Status Code: 204 No Content
  • Description: Cache cleared successfully
  • Body: Empty

Error Responses

401 Unauthorized
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache",
"request_id": "request-id",
"message": "Unauthenticated."
}
400 Bad Request
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache",
"request_id": "request-id",
"message": "Request could not be processed."
}

Clear OPcache

Purge the PHP OPcache for a specific box. This is useful after deploying new PHP code to ensure the latest code is being executed.

Endpoint

DELETE /v1/boxes/{id}/cache/opcache

Request Parameters

Parameter Location Type Required Description
id Path string Yes The ID of the box
Authorization Header string Yes Bearer token (JWT)

Responses

Success Response

  • Status Code: 204 No Content
  • Description: OPcache cleared successfully
  • Body: Empty

Error Responses

401 Unauthorized
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache/opcache",
"request_id": "request-id",
"message": "Unauthenticated."
}
400 Bad Request
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache/opcache",
"request_id": "request-id",
"message": "Request could not be processed."
}

Clear Varnish cache

Purge the Varnish cache for a specific box. This clears the HTTP caching layer and forces fresh content to be served.

Endpoint

DELETE /v1/boxes/{id}/cache/varnish

Request Parameters

Parameter Location Type Required Description
id Path string Yes The ID of the box
Authorization Header string Yes Bearer token (JWT)

Responses

Success Response

  • Status Code: 204 No Content
  • Description: Varnish cache cleared successfully
  • Body: Empty

Error Responses

401 Unauthorized
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache/varnish",
"request_id": "request-id",
"message": "Unauthenticated."
}
400 Bad Request
{
"timestamp": "timestamp",
"path": "/v1/boxes/{id}/cache/varnish",
"request_id": "request-id",
"message": "Request could not be processed."
}