Warmup Add
With this operation, you can ensure that your content is sent to the cache servers in advance and warmed up. Using the information below, you can perform the warmup operation with the API.
Method | Link |
---|---|
POST |
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
user_key | string | Yes | API User Token |
user_secret | string | Yes | API User Secret Token |
zone_id | integer | Yes | Zone ID |
files | array | No | The files list to be warmup. 1000 files per request |
Return Values
Variable | Type |
---|---|
status | bool |
Status Info
Status | Description |
---|---|
1 | Warmup successful completed. |
-1 | No response from origin. (Origin Response Http Code: 504-301-499) |
Example PHP Code
<?php
$curl_post_data = array(
'user_key' =>'Your User Key',
'user_secret' =>'Your User Secret',
'zone_id' =>'Zone Id',
'files' => array(‘/…filepath…/example1.jpg','/…filepath…/example2.txt’,’/…filepath…/example3.png’,’/…filepath…/example4.txt')
);
$request_body = json_encode($curl_post_data);
$service_url = 'https://api.medianova.com/v1/zone/warmup/add';
$ch = curl_init($service_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($request_body))
);
$response = curl_exec($ch);
$decoded = json_decode($response);
var_dump($decoded);
?>
Example Output
{
"status": true
}