After you add a domain name to Alibaba Cloud CDN, we recommend that you set a cache expiration time, set a bandwidth cap, and configure HTML optimization. These features increase the cache hit ratio, reinforce security, and improve content retrieval efficiency.

Increase the cache hit ratio and accelerate content delivery

Slow content delivery is typically related to low cache hit ratios. We recommend that you set a cache expiration time and configure the parameter filtering feature to increase the cache hit ratio.
Scenario Description Configuration
The cache hit ratio is low and content retrieval is slow The (time-to-live) TTL value for cached content is smaller than required or no cache expiration rule is created, which causes requests to be frequently redirected to the origin server. Set a proper TTL value to increase the cache hit ratio and accelerate content retrieval.
We recommend that you set a TTL value based on the following rules:
  • Specify a TTL value of one month or longer for static files that are infrequently updated, such as images and application packages.
  • Specify a TTL value based on your actual workloads for static files that are frequently updated, such as JavaScript and CSS files.
Create a cache expiration rule
By default, client requests are redirected to the origin server with the complete URLs retained, including parameters that follow the question mark (?). You can enable the parameter filtering feature to retain only specified URL parameters that follow the question mark (?) to increase the cache hit ratio and reduce the number of requests redirected to the origin server.
Note You can specify the parameters that you want to retain in URLs.
Enable Alibaba Cloud CDN to retain only specified URL parameters and ignore other URL parameters
By default, client requests are redirected to the origin server with the complete URLs retained, including parameters that follow the question mark (?). You can enable the parameter filtering feature to delete specified URL parameters that follow the question mark (?) to increase the cache hit ratio and reduce the number of requests redirected to the origin server.
Note You can specify the parameters that you want to retain or retain.
Enable Alibaba Cloud CDN to delete URL parameters

For more information about causes of low cache hit ratios, see Causes of low cache hit ratios.

Improve service security

To prevent bandwidth spikes caused by attacks, you can configure the monitoring and alerting features to monitor bandwidth values. Alternatively, you can set a bandwidth cap.
Scenario Description Configuration
Prevent high bandwidth values You can set a bandwidth cap. If a bandwidth value during a statistical period exceeds the bandwidth cap, Alibaba Cloud CDN suspends acceleration and disables the accelerated domain name. All requests that are destined for the accelerated domain name are directed to the origin server. Set a bandwidth cap
You can set alert rules in CloudMonitor to monitor bandwidth values. This allows you to detect and manage bandwidth anomalies at the earliest opportunity. Set an alert rule

Improve service performance

You can configure HTML optimization, object chunking, and intelligent compression based on your business requirements to reduce file sizes, accelerate content delivery, and improve page readability.
Scenario Description Configuration
Improve service performance Alibaba Cloud CDN automatically removes redundant content from web pages, such as comments and additional whitespace characters in HTML pages, CSS code, and JavaScript code. This reduces file sizes and accelerates content delivery. Enable HTML optimization
Clients retrieve specified file chunks from the origin server. In scenarios such as large file distribution, the amount of back-to-origin traffic can be reduced and content retrieval efficiency can be improved. Object chunking
CDN nodes use Gzip to compress text files before they are returned to users. This reduces the size of the requested files, accelerates content delivery, and reduces bandwidth usage. Configure intelligent compression