PrefetchObjectCaches

1. API Description

This interface is used to proactively prefetch content from the origin server to the cache nodes. The first access will directly hit the cache, reducing the load on the origin server.

2. Request Parameters

The following request parameters list only includes the required parameters for the interface.

Parameter NameRequiredTypeDescription

objectPaths

Yes

Array of String

Files to prefetch.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

Unique request ID, returned with each request. Provide this requestId when locating issues.

taskId

String

Prefetch task Id

4. Code Example

  1. Prefetch

POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-ZC-Action: PrefetchObjectCaches
<Common Request Params>

Request:
{
  "objectType": "Url",
  "objectPaths": ["http://cdntest.zenlayer.com/dir/1.jpg", "http://cdntest.zenlayer.com/dir/2.jpg"]
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "taskId": "taskId-xxxxxx"
  }
}

5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see Common Error Codes.

Last updated