百度智能云

All Product Document

          CDN Abroad

          URL Refresh

          Interface

          This interface is used to clear cached files and supports to submit all. You can submit 100 URLs at most at one time, and you can submit 20,000 URLs at most within 24 hours.

          Method Path Description
          POST /v2/abroad/cache/purge Purge cache

          Parameter Optional Type Description
          tasks Required list Task list

          PurgeTask field description

          Parameter Optional Type Description
          url Required String URL to be cleared
          type Optional String The default type is file, meaning precise URL purge, and when type is directory, it means directory purge.

          Remarks: When the directory is purged, the URL may end with / or not, but they are all directories. For example, directory purged with /a/ and /a is /a/.

          Response code(Http Status Code)

          Http Status Code Description
          201 The refreshing task is accepted successfully
          400 The resource does not belong to the current user, and the number of urls exceeds the limit for one time (100 pieces at most at one time).
          403 Quota is insufficient.

          Response body

          Parameter Type Description
          id string Task id
          POST /v2/abroad/cache/purge HTTP/1.1 
          Host: cdn.baidubce.com 
          Content-Type: application/json
          Authorization: xxxxxx 
          Connection: keep-alive 
          Content-Length: 121
          { 
              "tasks": [ 
                  { 
                      "url": "http://www.example.com/test.jpg", 
                      "type": "file" 
                  }, 
                  { 
                      "url": "http://www.example.com/a/", 
                      "type": "directory" 
                  } 
              ] 
          } 
          
          HTTP/1.1 201 Created 
          Server: nginx/1.1.10 
          Date: Tue, 07 Jul 2020 09:44:02 GMT 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          Connection: keep-alive 
          x-bce-request-id: b652b31c-6db8-b248-feee-93de3d37be7
            
          {"id":"eJwFwckNACAMA7CJKpVewI9ZQsP+I2BH6gjTOKg0+LhSjSWwWPJIyvamt09wfvW4C64="} 
          Previous
          Statistics Interface
          Next
          Record Query