Configures the HTML optimization feature for an accelerated domain name.

You can use the HTML optimization feature to delete notations and repeated blank characters in HTML, JavaScript, and CSS. This removes redundant content from web pages, reduces file sizes, and improves content delivery.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetOptimizeConfig

The operation that you want to perform. Set the value to SetOptimizeConfig.

DomainName String Yes www.macaron.org.cn

The accelerated domain name for which you want to configure the HTML optimization feature. You can configure the HTML optimization feature for only one domain name in each call.

Enable String Yes On

Specifies whether to enable the HTML optimization feature. Valid values:

  • On: yes
  • Off: no

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

Examples

Sample requests

http://cdn.aliyuncs.com/?Action=SetOptimizeConfig
&Enable=on
&DomainName=example.com
&<Common request parameters>

Sample success responses

XML format

<SetOptimizeConfigResponse>
      <RequestId>AED00EC1-32A8-4D48-BEB9-BD782AF3C6BD</RequestId>
</SetOptimizeConfigResponse>

JSON format

{
    "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HttpCode Error code Error message Description
400 InvalidEnable.ValueNotSupported The specified value of parameter Enable is not supported. The error message returned because the Enable parameter is set to an invalid value. Valid values are On and Off.

For a list of error codes, visit the API Error Center.