If you need to accelerate both dynamic and static resources, you can enable dynamic acceleration and define custom acceleration rules for static resources by configuring static file types. This ensures static files use a more suitable acceleration method, allowing them to be cached on points of presence (POPs) while requests for dynamic resources use optimized routing for origin fetches.
Background information
The following rules apply to accelerating dynamic and static resources:
-
Enabled
If you need to accelerate both static and dynamic resources, enable the Dynamic Acceleration switch. You can then configure acceleration rules for static file types based on your business requirements. After you complete the configuration, resources are accelerated according to your specified rules. You can customize the file types for edge cache, the URIs of static files to be cached, and the resource directories for static acceleration.
-
Disabled
If you do not need to accelerate dynamic resources, disable the Dynamic Acceleration switch. After you disable dynamic acceleration, dynamic resources are no longer accelerated. Instead, they are processed based on the static edge cache logic. In this case, the default static file acceleration rules take effect, and any manually added static file acceleration rules become invalid.
By enabling dynamic acceleration and configuring static file types, you can accelerate dynamic and static content separately. This allows static assets to be cached on points of presence (POPs) for faster access, while dynamic pages use an optimized route to fetch the latest content from the origin server.
For example, the following describes a typical configuration for a WordPress site:
-
Enable the Dynamic Acceleration switch. This ensures that dynamic pages, such as those generated by PHP, use intelligent routing to retrieve the most up-to-date content from the origin server.
-
In the Static File Types settings, add the filename extensions for common static assets on your site, such as
jpg,png,gif,css,js,ico,svg,mp4,woff. DCDN caches these static resources on points of presence (POPs), reducing the load on your origin server and improving access speed. -
When you configure cache expiration, set a long cache duration, such as 30 days, for rarely updated assets, such as images and videos. For frequently updated assets, such as CSS and JS files, set a shorter cache duration, such as 1 day. For dynamic files like PHP, we recommend setting the cache duration to 0s to prevent them from being cached.
Procedure
-
Configure static file types.
-
Log on to the DCDN console.
-
In the left-side navigation pane, click Domain Names.
-
On the Domain Names page, find the target domain and click Configure.
-
In the left-side navigation pane of the domain, click Acceleration Rules.
-
Enable the Dynamic Acceleration switch.
-
On the Static File Types tab, click Modify.
-
In the Static File Types dialog box, configure Static File Types.

Parameter
Description
Static File Types
Supported types of static files:
-
Images: GIF, PNG, BMP, JPEG, and JPG.
-
Webpages: HTML, HTM, and SHTML.
-
Audio and video files: MP3, WMA, FLV, MP4, WMV, OGG, and AVI.
-
Documents: DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, and PDF.
-
Others: ZIP, EXE, TAT, ICO, CSS, JS, SWF, APK, M3U8, TS, EJS, SVG, WOFF, and OTF.
-
-
Click OK.
-
-
Configure cache expiration.
-
In the Cache Expiration section, click Add.
-
In the Cache Duration dialog box, configure a cache rule. You can set rules by Directory or Filename Extension.

Parameter
Description
Type
Specify the scope of resources by Directory or Filename Extension.
-
Directory: Set the same cache rule for all resources in a specified path.
-
Filename Extension: Set the same cache rule for resources of a specified file type.
Content
The directory or filename extension to which the rule applies.
-
If you set Type to Directory, note the following:
-
You can add only one directory at a time. A forward slash (/) matches all directories.
-
Enter the full path of the directory. The path must start with a forward slash (/). Example: /directory/aaa.
-
-
If you set Type to Filename Extension, note the following:
-
You can enter one or more filename extensions. Separate multiple extensions with a comma (,), for example,
jpg,txt. The input is case-sensitive.Supported types of static files:
-
Images: GIF, PNG, BMP, JPEG, and JPG.
-
Webpages: HTML, HTM, and SHTML.
-
Audio and video files: MP3, WMA, FLV, MP4, WMV, OGG, and AVI.
-
Documents: DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, and PDF.
-
Others: ZIP, EXE, TAT, ICO, CSS, JS, SWF, APK, M3U8, TS, EJS, SVG, WOFF, and OTF.
-
-
You cannot use an asterisk (*) to match all file types.
-
Expire In
The cache TTL for resources. The maximum duration is 3 years. We recommend the following settings:
-
For static files that are not frequently updated, such as images and application packages, set the TTL to one month or longer.
-
For frequently updated static files, such as JS and CSS files, set a custom TTL based on your business needs.
-
For dynamic files, such as PHP, JSP, and ASP files, set the TTL to 0s to prevent them from being cached.
Honor origin cache policy
If enabled, cache policy headers from the origin server, such as Cache-Control and Pragma, take precedence.
Ignore origin no-cache header
When this feature is enabled, DCDN POPs will ignore the following cache policy headers from the origin server's response. These headers indicate that the content must not be cached.
-
Cache-Control: no-store
-
Cache-Control: no-cache
-
Cache-Control: max-age=0
-
Pragma: no-cache
Client follows DCDN cache policy
When this feature is enabled, the DCDN POPs will respond to the client with the effective cache policy.
Force revalidation
This parameter takes effect only when the cache TTL is set to 0. The effects are as follows:
-
Disabled (default): When the cache TTL for /DCDN is set to 0, the /DCDN POPs do not cache files, and an origin fetch is performed for every request.
-
Enabled: When the cache TTL for DCDN is set to 0, files can be cached on DCDN POPs, and every request requires an origin fetch to validate the cached content.
Weight
The priority of the cache rule. Valid values are integers from 1 to 99. A larger value indicates a higher priority. The rule with the highest priority is applied first.
Note-
If you configure multiple cache rules, set a different weight for each rule to control their execution priority.
-
If multiple rules have the same weight, the rule that was created earlier has a higher priority, regardless of the rule type.
-
If multiple cache policies are configured, DCDN stops matching other cache policies after one policy takes effect.
Rule condition
A rule condition allows a rule to be applied only when a request meets specific criteria.
ImportantWhen a feature references rule conditions, the execution order follows the priority of the associated rule conditions, not the order of the feature configurations.
-
Do not use: Disables conditional rules.
-
You can add or edit conditional rules in the Rules engine.
-
-
Click OK.
-