百度智能云

All Product Document

          CDN

          Query the Cache Expiration Rules

          Interface

          This interface is used to query the cache policy of the specified accelerated domain name. The domain name shall belong to the user, otherwise it returns 403 failure.

          Method Path Description
          GET /v2/domain/{domain}/config?cacheTTL Query the cache policy of the domain name

          domain: Accelerated domain name for which CDN has to be queried.

          Response code (Http Status Code)

          HTTP Status Code Description
          200 Success

          Response body

          Parameter Type Description
          cacheTTL CacheTTL List of cache rules

          CacheTTL

          Parameter Optional Type Description
          type Required String "suffix" means the file name suffix, "path" means the directory in the url, “origin" means the origin server rule. There is only one such rule, and only the weight is required. The value is “-", and ttl is 0. “code" means exception code cache. For example, you can configure 404 to cache 100 s.
          value Required String Configuration rules of the specified type
          weight Optional Int Weight, an integer between 0-100. The higher the weight, the higher the priority. The default is 0, and the priority is of no use when it is code type and can be ignored.
          ttl Required Int Cache duration, in seconds

          Request example

          GET /v2/domain/myself.baidu.com/config?cacheTTL HTTP/1.1 
          Host: cdn.baidubce.com 

          Response example

          HTTP/1.1 200 OK 
          Server: nginx 
          Date: Wed, 26 Jun 2019 03:42:11 GMT 
          Content-Type: application/json; charset=utf-8 
          Transfer-Encoding: chunked 
          Connection: keep-alive 
          X-Powered-By: PHP/7.1.5 
          x-bce-request-id: ab205979-7024-f90f-4995-d9b0fc599ad1
          
          {"cacheTTL":[{"type":"suffix","value":".jpg","ttl":36000,"weight":30,"override_origin":true}]} 
          Previous
          Set the Cache Expiration Rules
          Next
          Set the Cache Parameter Filter Rules