网页加速、下载分发、全站加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速
通过接口自助查询压缩响应配置
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 否 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
compression-settings | Object | 是 | 压缩响应功能配置
1.需要设置压缩响应配置时,此项必填
2.为 |
compression-enabled | String | 是 | 开启压缩响应功能:允许值为true和false |
path-pattern | String | 是 | url匹配模式,支持正则,如果是全部匹配,入参可以配置为:.* |
ignore-letter-case | String | 否 | 是否忽略大小写:允许值为true和false |
file-types | List | 否 | 配置需要压缩的文件类型,默认只对'text'文件类型压缩,配置为*时压缩任意文件类型 |
参数名称 | 类型 | 描述 |
---|---|---|
preDeployId | String | 预部署任务的id,可以根据这个id查询预部署的进展和结果 |
#!/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/predeploy/compresssetting/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "compression-settings":{ "compression-enabled":"true", "path-pattern":"*", "ignore-letter-case":"true", "file-types":[ "image/jpeg", "application/" ] } }'
HTTP/1.1 202 Accepted Server: openresty/1.11.2.2 Date: Mon, 27 May 2019 07:35:20 GMT Content-Type: application/json;charset=utf-8 Content-Length: 50 Connection: keep-alive App-Name: service_confApi x-cnc-request-id: ef140ea0-0815-4161 {"preDeployId":"bcb6e12cd2b24f558fda3c06d9ba131e"}