百度智能云

All Product Document

          CDN

          Cache Management

          Cache Management

          Prefetch Cache

          	 $tasks = array( 
          	    array( 
          	        'url' => 'http://my.accelerate.domain/path/to/file' 
          	    ) 
          	 ); 
          	 $resp = $client->prefetch($tasks); 
          	 //Query prefetching results according to the prefetching task id. 
          	 $resp = $client->listPrefetchStatus($resp->id); 
          	 print_r($resp); 

          Query Prefetching Result

          	 $url = 'http://your.domain.com/1.jpg'; 
          	 $startTime = "2016-10-07T16:00:00Z"; 
          	 $endTime = "2016-10-07T18:00:00Z"; 
          	 $resp = $client->listPrefetchStatus('', $url, $startTime, $endTime); 
          	 print_r($resp); 

          When querying the prefetching results, you can use the above-mentioned methods of passing url, start and end time, also pass the id returned when submitting the prefetching tasks.

          Refreshing Prefetch

          	 $tasks = array( 
          	    array( 
          	        'url' => 'http://my.accelerate.domain/path/to/file', 
          	    ), 
          	    array( 
          	        'url' => 'http://my.accelerate.domain/path/to/directory/', 
          	        'type' => 'directory', 
          	    ), 
          	 ); 
          	 $resp = $client->purge($tasks); 
          	 //Query the refresh results according to the refresh task id. 
          	 $resp = $client->listPurgeStatus($resp->id); 
          	 print_r($resp); 

          Refresh supports two different refresh methods, namely url refresh and directory refresh. When the directory refresh is used, you need to introduce the type field as directory.

          Query Purge Results

          	 $url = 'http://your.domain.com/1.jpg'; 
          	 $startTime = "2016-10-07T16:00:00Z"; 
          	 $endTime = "2016-10-07T18:00:00Z"; 
          	 $resp = $client->listPurgeStatus('', $url, $startTime, $endTime); 
          	 print_r($resp); 

          Query Daily Quota of Purging and Prefetching

          $resp = $client->listQuota(); 
          print_r($resp); 

          Operation Records

          $resp = $this->client->getRecords(); 
          print_r($resp)
          Previous
          Acceleration Domain Name Configuration
          Next
          Dynamic Acceleration Interface