Data Types

ResetCache

Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account.

You can choose to reset the edge cache, or permanent cache, or both caches.

Warning: Resetting the permanent cache (by setting resetPermanentCache: true) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request.

Recommended: Prevent cache resets by adding a ?v=<etag> querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The etag field is returned by GetFileDetails and all upload operations, and can be saved to your database.

Example patterns:

"/*"

"/raw/example.jpg"

"/image/example.jpg"

"/image/customers/abc/*"

You may only use * at the end of the pattern. You must not include your account ID prefix in the pattern.

POST /v2/accounts/{accountId}/cache/reset
cURL
1curl "https://api.bytescale.com/v2/accounts/{accountId}/cache/reset" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d @- << EOF
5 {
6 "pattern": "/raw/example.jpg",
7 "resetEdgeCache": true,
8 "resetPermanentCache": true
9 }
10EOF
Response (200)
1{
2 "jobDocs": "https://www.bytescale.com/docs/job-api/GetJob",
3 "jobId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
4 "jobType": "ExampleJob",
5 "jobUrl": "https://api.bytescale.com/v2/accounts/FW25aki/jobs/ExampleJob/01ARZ3NDEKTSV4RRFFQ69G5FAV"
6}

Your account ID.

This is visible on the settings page:

https://www.bytescale.com/dashboard/settings

Example: "A623uY2"

Type: String

Length: 7

Add one of these Authorization header values to your request:

Option 1: prefix "Bearer " to your API key. The result is your Authorization header value.

Option 2: use HTTP basic authorization with apikey as your username and your API key as your password.

For advanced options, please see:

https://www.bytescale.com/docs/auth

Type: String

This endpoints requires a JSON request body.

Type: String

Value: "application/json"

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: