百度智能云

All Product Document

          CDN

          Preload Cache

          This interface is used to notify the specified URLs cached by CDN in advance, and it supports to submit all. You can submit 1,000 URLs at most at one time, and you can submit 20,000 URLs at most within 24 hours.

          Method Path Description
          POST /v2/cache/prefetch Submit the prefetch task

          Request body

          Parameter Optional Type Description
          tasks Required list type, PrefetchTask content items are explained as follows::
          - url: Required, String type, representing the URL to prefetch.
          - speed: Optional, Int type, indicating the speed limit of prefetch, in byte/s, and it defaults to be 0 (unlimited).
          - startTime: Optional, Timestamp type, UTC time, startTime shall be greater than the current time and within 24 hours, otherwise it fails. The format is: 2016-04-16Z23:00:00T,It defaults to immediate execution.
          Details of the prefetch task list submitted

          Response code (Http Status Code)

          HTTP Status Code Description
          201 Success

          Response body

          Parameter Type Description
          id String The Prefetch Id this time can be used for querying the task status

          Request example

          POST /v2/cache/prefetch HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Length: 145
          Content-Type: text/json;utf-8
          
          { 
              "tasks": 
              [ 
                  { 
                      "url":"http://my.domain.com/path/to/prefetch/1.data" 
                  }, 
                  { 
                      "url":"http://my.domain.com/path/to/prefetch/2.data" 
                  } 
              ] 
          } 

          Response example

          HTTP/1.1 201 Created 
          Content-Length: 91
          Content-Type: application/json;utf-8
          x-bce-request-id: 81d0b05f-5ad4-1f22-8068-d5c9de60a1d7
          Server: BCE-CDN 
          { 
              "id": "419d6f1e9acb0442341e9b8e1e7fbf9f" 
          }
          Previous
          Statistics Interface
          Next
          Query Preload Status