All Products
Search
Document Center

Anti-DDoS:Anti-DDoS Lab

Last Updated:Feb 22, 2024

Anti-DDoS Pro and Anti-DDoS Premium provide scrubbing centers that are integrated with web caching techniques to protect your website services against DDoS attacks and reduce page load time. This topic describes how to configure the static page caching feature.

Prerequisites

Your website is added to an Anti-DDoS Pro or Anti-DDoS Premium instance that uses the Enhanced function plan. For more information, see Add websites.

Background information

After the static page caching feature is enabled, the Anti-DDoS Pro or Anti-DDoS Premium instance automatically detects whether the web pages that a client requests contain the resource types that are defined in the caching policy. If the web pages contain the resource types that are defined in the caching policy, the web pages are cached. The next time the client requests the same page, the Anti-DDoS Pro or Anti-DDoS Premium instance directly returns the pages. This accelerates client access. You can customize caching rules for a specific page.

Procedure

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

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

    • Anti-DDoS Proxy (Chinese Mainland): If your instance is an Anti-DDoS Pro instance, select Chinese Mainland.

    • Anti-DDoS Proxy (Outside Chinese Mainland): If your instance is an Anti-DDoS Premium instance, select Outside Chinese Mainland.

    You can switch the region to configure and manage Anti-DDoS Pro or Anti-DDoS Premium instances. Make sure that you select the required region when you use Anti-DDoS Pro or Anti-DDoS Premium.

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

  4. In the upper part of the Website Acceleration page, select the domain name that you want to manage. In the Static Page Caching section, turn on Status and configure the Mode parameter.

    Important

    You can enable the static page caching feature only for the domain names that are associated with an Anti-DDoS Pro or Anti-DDoS Premium instance that uses the Enhanced function plan.

    • Standard: If the requested page contains static resources such as CSS, JavaScript, or TXT files, the page is cached.

    • Enhanced: All requested pages are cached.

    • No Caching: No requested pages are cached.

    After you enable the static page caching feature for the domain name, the caching policy takes effect on all URIs in the domain name. If you want to enable the static page caching feature for only a specific URI, we recommend that you set the Mode parameter to No Caching and perform the following steps to configure a custom caching rule.

  5. Optional. Configure a custom caching rule for a specific URI.

    Important
    • The custom caching rule takes effect only after you turn on Status. The custom caching rule preferentially takes effect over the caching policy of the domain name.

    • You can create a maximum of five custom caching rules.

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

    2. On the page that appears, click Create Rule in the upper-right corner. In the Create Rule dialog box, configure the parameters and click OK.

      Parameter

      Description

      Name

      The name of the rule.

      The name can contain letters, digits, and underscores (_). The name can be up to 128 characters in length.

      URI

      The URI of the page to be cached.

      Request parameters and wildcards are not supported for the URI parameter.

      For example, /a/ represents all pages in the path <Domain name>/a/.

      Mode

      The mode for the caching policy. Valid values:

      • Standard Mode: If the requested page contains static resources such as CSS, JavaScript, or TXT files, the page is cached.

      • Strong Mode: All requested pages are cached.

      • No Caching: No requested pages are cached.

      Cache Expires In

      The validity period of the cached resources. Default value: Use Origin Configurations. This value indicates that the validity period of the cached resources configured for the origin server is used. You can also select 1Hour(s), 1 Days, 10 Days, or 30 Days.

You can view created rules and click Edit or Delete to manage the rules in the rule list. You can also click Refresh Cache to manually refresh the cache of the page.