Help Center> Content Delivery Network> Getting Started> (Optional) Recommended Configurations
Updated on 2023-12-28 GMT+08:00

(Optional) Recommended Configurations

After adding an acceleration domain name, configure cache rules, smart compression, and secure acceleration to improve the cache hit ratio, optimize the acceleration effect, and enhance security.

Improving Cache Hit Ratio and Optimizing the Acceleration Effect

Scenario

Configuration Item

Description

The cache hit ratio is low and the acceleration effect is not obvious.

Cache Rules

Proper cache time to live (TTL) and priority settings for different resources can improve the cache hit ratio, reduce the origin pull ratio, and relieve the pressure on the origin server.

Notes:

  1. When configuring cache rule priority, enter an integer ranging from 1 to 100. A greater number indicates a higher priority.
  2. If you modify or add a cache rule, refresh the cache of the corresponding resource.
  3. Set the cache TTL of dynamic resources to 0, so dynamic resources are not cached. Otherwise, access exceptions may occur.
  4. Check the cache settings on the origin server. If no-cache, private, or no-store is configured for a resource on the origin server and Origin Cache Control is enabled on the CDN console, CDN cannot cache the resource. CDN needs to pull the resource from the origin server each time it is requested. This does not achieve acceleration.

Range Requests

Configure range requests to accelerate distribution of large files during origin pull and reduce bandwidth consumption.

  • Range requests are enabled by default for download acceleration.
  • Check whether the origin server supports the Range header.

Smart Compression

Compress static content on your websites by reducing file size. This speeds up file transfer and saves you a lot of bandwidth.

  • Smart compression includes gzip compression and Brotli compression. The performance of Brotli compression is 15% to 25% higher than that of gzip compression.
  • With smart compression, CDN automatically compresses .js, .html, .css, .xml, .json, .shtml and .htm files.

URL Parameter Filtering

Enable URL parameter filtering to improve the cache hit ratio and speed up content distribution.

  • If resources do not change with URL parameters, ignore URL parameters when configuring URL parameter filtering.
  • If resources change with URL parameters, do not ignore URL parameters when configuring URL parameter filtering.

Improving Website Security

Scenario

Configuration Item

Description

Improving security performance

HTTPS

Configure an SSL certificate to improve the domain name security.

Access Control

Identify and filter visitors to restrict their access and improve CDN resource security.

Accelerating Resources Protected by WAF

Huawei Cloud CDN works with WAF to defend against web attacks during content delivery acceleration, providing a more secure acceleration experience.

Reducing the Risk of High Bills

Scenario

Configuration Item

Description

If your domain name is attacked or has malicious traffic coming, there may be sudden traffic spikes that result in a bill higher than your normal expenditures. CDN can help you reduce the risk of high bills.

Usage Cap

When the usage cap is set, CDN will disable your domain names when the access bandwidth reaches the threshold you specify to avoid excessive fee.