Media Acceleration Live Broadcast

UpdateCompressionConfig

Update time: 2025-08-14 11:27:33

Modify compress setting configurations.

  • Limit Description: · The accelerated domain name must have been filed. · Accelerated domain names must not contain the following information: sales of drugs and controlled tools, including illegal speech and information. · Video-accelerated domain names must have audiovisual licenses; blog forums or community-based accelerated domain names must have BBS special approval qualifications. · Interface requests and return results only accept xml format.
  • Limit of request rate per user: 300/5min
  • Applicable Products: Content Acceleration,Dynamic Web Acceleration,Media Acceleration,Media Acceleration Live Broadcast
For API authentication details, please refer to: API Authentication Overview

Request

Path Params

NameDescription
domain-nameString

The domain whoes need query config.

Body Params

NameDescription
*compression-settingsObject

Compress setting config

compression-enabledString

To enable compress setting, allowed true or false.

br-typesString

Use br compression.The allowed values are true and false.

specify-url-patternString

Specify URI

custom-file-typesList

Custom file type: In addition to the specified file type, fill in the appropriate recognizable file type according to your own needs. It can be used in conjunction with uri-file-types. If uri-file-types is also configured, the actual effective file type is the sum of the two input parameters.

file-typesList

Define the MIME file types to be compressed. 'text/' will be compressed by default.

ignore-letter-caseString

Whether to ignore letter case.

path-patternString

The url matching mode. If all matches, the input parameters can be configured as: .*

custom-patternString

Specify Regular Pattern.The allowed values are homepage and all.

uri-file-typesList

File type: Specifies the type of file to cache. File types include: gif png bmp jpeg jpg html htm shtml mp3 wma flv mp4 wmv zip exe rar css txt ico js swf If you need all types, simply pass all. Multiple types are separated by semicolons; all and specific file types cannot be configured at the same time.

directoryString

Directory

file-type-othersList

Another way to specify the file type to open the compressed response, and configuration will be cleared when input empty.

Response

Body Params

NameDescription
codeString

The error code, when HTTPStatus is not 202, indicates the type of error the current request is calling.

httpStatusInteger

httpstatus=202; Indicates that the new domain API was successfully invoked, and the current deployment of the new domain can be viewed using x-cnc-request-id in the header

x-cnc-request-idString

Uniquely labeled id for querying each requested task (for all interfaces)

messageString

Response information, when success is successful

Error code

Error code(code)Description(message)HTTP statusSemantic
NoSuchDomain

The specified domain does not exist.\n\n

404The specified domain does not exist.\n\n
CustomerNoOwnDomain

customer not own domain name[www.example.com].\n\n

400customer not own domain name[www.example.com].\n\n
ConfigError

The config {0} does not access.\n\n

400The config {0} does not access.\n\n
InvalidParameter

example: 1. No domain was specified.2.The {0} is invalid.\n\n

400example: 1. No domain was specified.2.The {0} is invalid.\n\n

Example

JSON
XML
JSON
Request example
Copy Copy success
#!/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://api.cdnetworks.com/api/config/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/" ],
 "uri-file-types":[ "mp3", "zip" ],
 "custom-file-types":[ "json", "wasm" ],
 "custom-pattern":"homepage",
 "directory":"/directory/",
 "specify-url-pattern":"/abc/.*",
"br-types":"true"
}
}'
Response example
Copy Copy success
HTTP/1.1 202 Accepted
Server: openresty/1.11.2.2
Date: Mon, 27 May 2019 07:15:49 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 31
Connection: keep-alive
App-Name: service_confApi
x-cnc-request-id: 90d3b33c-3931-4436
{
    "message":"success",
    "code":""
}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!