All Products
Search
Document Center

Edge Security Acceleration:Increase the cache hit ratio for ESA

Last Updated:Nov 28, 2025

Increasing the cache hit ratio involves optimizing cache policies to serve more user requests directly from the cache. This reduces the load on your origin server, improves access speed and the user experience, lowers latency and operational costs, and ensures system stability.

Cache optimization policies

You can configure edge cache TTL, query strings, query string sorting, and Cache Reserve to increase the cache hit ratio. This reduces origin requests and improves the overall performance and stability of your website.

Edge cache TTL

You can use cache analysis to configure a suitable edge cache TTL for your resources and increase the cache hit ratio.

Global configuration

You can configure a global cache TTL if most of your website's resources have similar lifecycles or update frequencies.

In cache analysis, if a high percentage of resources have a Cache Status of EXPIRED, this indicates that the preset cache duration has expired. Increase the cache hit ratio by configuring a longer edge cache TTL.

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Caching > Settings.

  3. In the Edge Cache TTL section, click Configure. Select Use Custom TTL and set a longer TTL, such as 30 days.

    image

Rule-based configuration

If Cache analytics shows that a high proportion of responses for files with the .jpg suffix have a Cache Status of EXPIRED, it means the preset cache TTL for files with the .jpg suffix has expired. You can use a rule to configure the edge cache expiration time to increase the cache hit ratio.

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Rules > Cache Rules.

  3. Click Create Rule and enter a Rule Name.

  4. Expression: The hostname is www.example.com and the file name extension is .jpg.

    Action: Select Eligible for Cache. For Edge Cache TTL, choose Use Custom TTL and set it to 30 days.

    image

Query string

If URL parameters have little impact on resource content, or if parameter changes do not affect the actual content, you can configure query strings or custom cache keys. This reduces duplicate caching for the same resource and improves the cache hit ratio.

Global configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Caching > Settings.

  3. In the Query String section, click Configure and select Ignore All.

    image

Rule-based configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Rules > Cache Rules.

  3. Click Create Rule and enter a Rule Name.

  4. Expression: The hostname is www.example.com.

    Action: In the Custom Cache Keys section, click Configure and select Ignore All.

    image

Sort query strings

If requested resources, such as images and JavaScript files, are not affected by the order of query parameters, you can sort the query strings. This standardizes identical requests, reduces the number of cache entries, lowers the cache replacement frequency, and improves the cache hit ratio.

Global configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Caching > Settings.

  3. You can enable Sort Query Strings.

    image

Rule-based configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Rules > Cache Rules.

  3. Click Create Rule and enter a Rule Name.

  4. Expression: The hostname is www.example.com.

    Action: In the Custom Cache Keys section, click Configure and set Sort Query Strings to Yes.

    image

Prefetch frequently accessed resources

You can prefetch popular resources before peak business periods, such as promotions and live streams. You can submit prefetch tasks from the console to load these resources onto point of presences (POPs) in advance. This improves the cache hit ratio.

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Caching > Prefetch Cache.

  3. In the Instant Prefetch section, enter the URLs and click Submit.

    image

Cache reserve

You can prioritize and retain frequently accessed or critical resources in the cache to reduce reliance on the origin server. This results in faster response times, a lower origin server load, and savings on network bandwidth and operational costs. It also improves the overall user experience.

Important
  • Cache Reserve is a pay-as-you-go feature. You are charged based on the storage capacity of the instance that you purchase.

  • Before using the Cache Reserve feature, enable Smart Tiered Cache and Regional Tiered Cache for multi-tiered caching. Then, create a cache rule to filter origin requests for popular files. This reduces the required storage space for Cache Reserve and helps you save costs.

Global configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Caching > Cache Reserve.

  3. In the Cache Reserve section, click Configure. Turn on the Status switch and select a purchased Instance.

image

Rule-based configuration

  1. In the ESA console, go to Websites. In the Website column, click the target website.

  2. In the navigation pane on the left, choose Rules > Cache Rules.

  3. Click Create Rule and enter a Rule Name.

  4. Expression: The hostname is www.example.com.

    Action: In the Cache Reserve section, click Configure and select Eligible For Cache Reserve.

    image