Cache Configuration
During CDN acceleration, the configuration of caching rules is very important. Configuring appropriate caching rules can achieve the effect of half the effort. Through this article, you can understand how to configure it and related considerations, etc.
I. Cache Rule Configuration
Operation Steps
-
You can modify and set appropriate caching rules based on actual needs at the time of creating a domain name, which provides default cache rules.
-
You can go to the domain name configuration details page, select
Domain Name Configuration
→Basic Settings
→Cache Configuration
→ Modify Cache Rules, to do the corresponding configuration related to cache for a domain name.
Domain name creation:
Default caching rules:
If the acceleration type is: Page
Default cache rules are:
1、 Priority is given to follow the cache rules of the source station. If the source station has no cache rules, then the following cache rules are followed by default
2、Dynamic files: (php|aspx|asp|jsp|do|dwr|cgi|fcgi|action|ashx|axd|json) are not cached
3、All other files, cached for 30 days.
4、If the source station returns a response header information: no-cache 、no-store , it will not be cached.
If the acceleration type is: Download/On-Demand
Default cache rules are:
1、All files are cached for 30 days, following the source station cache.
If the acceleration type is: Full site acceleration
The default rule is:
1、All files are not cached, following the source station cache
Parameter Cache configuration
The retain or ignore parameter cache strategy can be configured in the cache configuration of the domain name configuration. If custom parameter effectiveness is required, please contact technical support for non-standard configuration.
Default parameter cache rules:
If the acceleration type is: Page
The default is parameter caching
If the acceleration type is: Download/On-Demand
Default removed parameter caching
Domain name configuration:
Click to configure cache rules, you can match and configure different website elements according to business needs, including remove parameter cache configuration.
When you finish the configuration at the domain name configuration, please make sure to click on Confirm Configuration
to successfully modify the configuration.
Cache Configuration Item Explanation
Configuration Item | Explanation |
---|---|
Priority | |
Website Elements | |
Path Template | |
Cache Time | |
Whether to Cache | |
Whether to Comply Source Station |
Path Template Explanation:
1. The slash / represents the website homepage, /xx/ represents the homepage of the /xx/ subdirectory
2. The slash at the beginning /news/ * represents all files under the news directory
3. /(news|xiao)/ * represents all files under the news and xiao directories
4. The slash at the beginning / * represents all files
5. The slash at the beginning / *.jpg represents all jpg files, including all jpg files in subdirectories such as /xx/
6. The slash at the beginning / .(html) represents all html type files under the root directory, /.(html|js) represents all html and js type files under the root directory
7. The slash at the beginning /news/image.jpg represents the specific image.jpg file under the news directory, news(image.jpg|logo.jpg) represents the image.jpg and logo.jpg files under the news directory
II. Special Status Code Cache
Operation Steps
The expiration time of the status code for the specified directory or file can be configured in the cache configuration of the domain name configuration.
1、Enter the domain name configuration details page, choose Domain Name Configuration
→ Basic Settings
→ Cache Configuration
→ Special Status Code Cache, and proceed with configuration
2、Add Status Code Cache
Configuration Item Explanation:
Configuration Item | Explanation |
---|---|
Status Code | |
Whether to Specify Directory or URL | |
Path | /.html , it can be a directory file eg: /news/ , it can be a detailed path file eg: /news/image.jpg |
Whether to Cache | |
Cache Time | |
Comply with Source Station |