All Products
Search
Document Center

Anti-DDoS:Anti-DDoS Lab

Last Updated:Mar 31, 2026

Anti-DDoS Proxy integrates web page caching with its scrubbing centers to protect your website services against DDoS attacks and accelerate access to static web pages. This topic explains how to enable and configure the website acceleration feature.

How it works

When a client requests a page, Anti-DDoS Proxy checks whether the page contains resource types covered by the active caching rule. If it does, the page is cached in the protection clusters. Subsequent requests for the same page are served directly from the cache, without reaching the origin server.

Cache freshness vs. cache retention

These two behaviors are independent and easy to confuse:

  • Cache freshness (Cache Expires In): How long a cached resource is considered valid before Anti-DDoS Proxy checks the origin again. Configurable per custom rule: 1 hour, 1 day, 10 days, or 30 days.

  • Cache retention (inactivity eviction): How long a resource stays in cache on a single host. A resource is evicted after 5 minutes of inactivity, regardless of the Cache Expires In setting. If a client requests the resource after eviction, Anti-DDoS Proxy fetches it from the origin server again.

Important

The website acceleration feature is designed for volumetric attack scenarios and behaves differently from Alibaba Cloud CDN. In low queries per second (QPS) environments, Anti-DDoS Proxy may frequently return X-Cache: MISS because cached resources are evicted before the next request arrives.

X-Cache response header

Anti-DDoS Proxy uses the X-Cache HTTP header to indicate cache status:

ConditionHeader returned to client
Origin response includes X-CacheAnti-DDoS Proxy passes the header through unchanged
Origin response does not include X-CacheAnti-DDoS Proxy returns X-Cache: MISS

Prerequisites

Before you begin, ensure that you have:

Enable static page caching

  1. Log on to the Anti-DDoS Proxy console.

  2. In the top navigation bar, select the region of your instance:

    • Chinese Mainland — for Anti-DDoS Proxy (Chinese Mainland) instances

    • Outside Chinese Mainland — for Anti-DDoS Proxy (Outside Chinese Mainland) instances

  3. In the left-side navigation pane, choose Anti-DDoS Lab > Website Acceleration.

  4. Select the domain name you want to manage.

  5. In the Static Page Caching section, turn on Status, then set the Mode parameter. After you enable a mode, the caching policy applies to all URIs in the domain. To cache only a specific URI, set Mode to No Caching and create a custom caching rule for that URI.

    Important

    Static page caching can only be enabled for domain names associated with an Anti-DDoS Proxy instance that uses the Enhanced function plan.

    ModeWhat gets cached
    StandardPages that contain static resources (CSS, JavaScript, or TXT files)
    EnhancedAll requested pages
    No CachingNothing — use this when you want custom rules to control caching for specific URIs

Create a custom caching rule

Custom caching rules let you apply a specific caching mode and expiry to a single URI path. A custom rule takes priority over the domain-level caching mode and is subject to a limit of five rules.

Important

Custom caching rules only take effect when Status is turned on.

  1. In the Static Page Caching section, click Settings.

  2. On the page that appears, click Create Rule in the upper-right corner.

  3. In the Create Rule dialog box, configure the following parameters, then click OK.

    ParameterDescription
    Rule nameA name for the rule. Use letters, digits, and underscores only. Maximum length: 128 characters.
    URIThe URI path to cache. Wildcards and request parameters are not supported. For example, /a/ matches all pages under <domain>/a/.
    ModeThe caching behavior for the matched URI: Standard Mode (cache pages with static resources), Strong Mode (cache all pages), or No Caching (bypass cache).
    Cache Expires InHow long cached resources are considered fresh. Default: Use Origin Configurations (honors the origin server's cache headers). Other options: 1Hours, 1Days, 10Days, 30Days. Resources are still evicted after 5 minutes of inactivity, regardless of this setting.

After the rule is created, it appears in the rule list. Use the Edit and Delete actions to manage the rule.

Refresh the cache

To force Anti-DDoS Proxy to fetch a fresh copy from the origin, click Refresh Cache in the rule list.

Use this after updating origin content when you want the cache to reflect the change immediately, without waiting for the resource to expire or be evicted.

Limitations

LimitationDetail
Required planWebsite acceleration is only available on the Enhanced function plan
Custom rulesMaximum of 5
URI matchingWildcards and request parameters are not supported in custom rule URIs
Cache retention5 minutes of inactivity per host; not configurable