文档中心 API文档 查询响应头内容缓存规则配置接口

查询响应头内容缓存规则配置接口

更新时间:2022-12-05 14:57:47

适用产品

直播分发、移动加速、网页加速、下载分发、全站加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发

接口描述

通过接口自助查询响应头内容缓存规则。

  • 调用URL: https://open.chinanetcenter.com/api/config/cachebyrespheader/*
  • 调用方法:GET
  • 限制说明:·在中国 加速域名必须已备案完成。 · 加速域名必须不包含如下信息:出售药物和管制刀具类,含有不法言论、信息。 · 视频类加速域名必须有视听许可证;博客论坛或社区类加速域名必须有BBS专项审批资质。 · 接口请求和返回结果接受xml和json格式。
推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Path 参数

参数名称类型必填描述
domain-name
String需要查询配置的域名或域名id

返回参数

Body 参数

参数名称类型描述
domain-name
String需要查询配置的域名或域名id
domain-id
String需要查询配置的域名或域名id
cache-by-respheaders
List
data-id
Long添加grid类型标识,表示客户多组配置时,具体某组配置
response-header
String响应头头部名称 需要缓存的响应头名称。如Cache-Control
is-respheader
String是否允许响应头内容缓存文件,可选值为true或false,true表示允许响应头内容缓存文件;false表示不允许响应头内容缓存文件
path-pattern
Stringurl匹配模式,支持正则,如果是全部匹配,入参可以配置为:.*
except-path-pattern
String例外的url匹配模式,某些URL除外:如abc.jpg,不做内容重定向
ignore-letter-case
String忽略大小写,可选值为true或false,true表示忽略大小写;false表示不忽略大小写; 新增配置项时,不传默认为 true
priority
String优先级
response-value
String头部值。

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/api/config/cachebyrespheader/a.example.com" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json"
返回示例
复制代码 复制成功
HTTP/1.1 200 OK
Server: openresty/1.11.2.2
Date: Fri, 24 May 2019 08:49:31 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 454
Connection: keep-alive
App-Name: service_confApi
x-cnc-request-id: 45ed9955-fb90-48d5
{
    "domain-id": "86773", 
    "domain-name": "a.example.com", 
    "cache-by-respheaders": [
        {
            "data-id": 1722838, 
            "response-header": "Location", 
            "response-value": ".", 
            "is-respheader": "false", 
            "path-pattern": null, 
            "except-path-pattern": null, 
            "ignore-letter-case": "true", 
            "priority": "10"
        }, 
        {
            "data-id": 1722372, 
            "response-header": "Server", 
            "response-value": ".", 
            "is-respheader": "true", 
            "path-pattern": null, 
            "except-path-pattern": ".*.jpg$", 
            "ignore-letter-case": "true", 
            "priority": "10"
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!