In this part of the documentation you can learn more about the API's cache resource. With this resource, it is possible to get information about your current cache status, as well as clear its content. We will also have a look at the associated data structures.
This resource supports the following operations:
Access URL | GET | GET (List) | PUT | PUT (Batch) | POST | DELETE | DELETE (Batch) |
---|---|---|---|---|---|---|---|
/api/caches |
If you want to access this resource, simply query the following URL:
Single cache details can be retrieved by using its id:
Field | Type | Comment |
---|---|---|
dir | string | The path to this cache directory |
size | string | Including size unit |
files | integer | Amount of files within the cache directory |
freeSpace | string | Free space, including the size unit |
name | string | The name of the cache |
backend | string | |
id | string | The identifier of this cache |
For this operation, no parameters are required. To get a list of all caches, simply query:
This API call returns an array of elements, one for each cache type. Each of these elements has the following structure:
Field | Type | Comment |
---|---|---|
dir | string | The path to this cache directory |
size | string | Spaced used by this cache's content, including size unit |
files | integer | Number of files within the cache directory |
freeSpace | string | Free space, including the size unit |
name | string | The name of the cache |
backend | string | |
id | string | The identifier of this cache |
Appended to the above-mentioned list, you will also find the following data:
Field | Type | Comment |
---|---|---|
total | integer | The number of cache resources |
success | boolean | Indicates if the call was successful or not. |
To delete a cache's content, simply call the specified resource with the DELETE
operation, as the following example shows:
Replace the id
with the specific cache id.
To delete all caches, simply call
without providing a cache id. You can also supply a list of caches to be deleted.
[
{
"id": "opcache"
},
{
"id": "config"
},
{
"id": "http"
}
]