To accelerate the delivery of both static and dynamic resources, you can enable the dynamic acceleration feature. You can customize acceleration rules for static resources by configuring static file types. In this case, static files no longer use dynamic acceleration. This allows you to cache static resources on edge nodes and to retrieve dynamic resources from the origin server over an optimal route.

Background information

The following acceleration rules are applicable to both static and dynamic resources:
  • Enable dynamic acceleration

    To accelerate the delivery of static and dynamic resources, you must turn on Dynamic Acceleration. You can configure acceleration rules for static file types based on your business requirements. Then, static and dynamic resources are distributed based on these custom acceleration rules. You can customize the file types, the Uniform Resource Identifiers (URIs), and the directories of static resources that can be cached on DCDN nodes.

  • Disable dynamic acceleration

    If you do not want to accelerate the delivery of dynamic resources, you can turn off Dynamic Acceleration. After dynamic acceleration is disabled, the dynamic resources are distributed without acceleration. Static resources are distributed based on edge cache rules. Only the default static file acceleration rules are valid. All custom static file acceleration rules become invalid.

Procedure

  1. Configure static file types.
    1. Log on to the DCDN console.
    2. In the left-side navigation pane, click Domain Names.
    3. On the Domain Names page, find the domain name that you want to manage and click Configure in the Actions column.
    4. The details page of the specified domain name appears. In the left-side navigation pane, click Acceleration Rules.
    5. Turn on Dynamic Acceleration.
    6. On the Static File Types tab, click Modify.
    7. In the Static File Types dialog box, choose to enable or disable Adaptive Caching, and then configure Static File Types.
      Static file types
      Parameter Description
      Adaptive Caching You can configure the adaptive cache settings based on the static file type and the cache rule of the origin server.
      • Enable Adaptive Caching
        If you enable adaptive caching, rules in Static File Types take precedence over adaptive cache rules. All cache rules that are configured for Cache Expiration in the DCDN console take effect. Cache rules take effect in the following priorities:
        • Priority 1: If you have configured Cache Expiration in the DCDN console, the cache rules configured in Cache Expiration are applied.
        • Priority 2: If you have not configured Cache Expiration in the DCDN console, the cache rules that are configured on the origin server are applied.
        • Priority 3: If you have not configured cache rules in the DCDN console or on the origin server, DCDN dynamically initiates back-to-origin requests.
      • Disable Adaptive Caching
        • If you disable adaptive caching and have configured Static File Types and Cache Expiration in the DCDN console, the cache rules configured in Cache Expiration in the DCDN console are applied.
          Note Make sure that the filename extensions specified in Cache Expiration are included in Static File Types. Otherwise, the cache rules configured in Cache Expiration do not take effect.
        • If you disable adaptive caching and have configured Static File Types but have not configured Cache Expiration, rules that are configured on the origin server are applied.
      Static File Types
      The following static file types are supported:
      • Images: GIF, PNG, BMP, JPEG, and JPG.
      • Web pages: HTML, HTM, and SHTML.
      • Audio and video files: MP3, WMA, FLV, MP4, WMV, OGG, and AVI.
      • Text files: DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, and PDF.
      • Others: ZIP, EXE, TAT, ICO, CSS, JS, SWF, APK, M3U8, and TS.
    8. Click OK.
  2. Create a cache expiration rule.
    1. In the Cache Expiration section, click Add.
    2. In the Cache Duration dialog box, select Directory or Filename Extension for the Type parameter and specify the other required parameters for the cache rule.
    3. Click OK.