Cache Configuration
During the CDN acceleration process, the configuration of cache rules is very important. Configuring appropriate cache rules can achieve twice the result with half the effort. Through this article, you can understand how to configure and related precautions, etc.
I. Cache Rule Configuration
Operation Steps
-
You can modify the default cache rules provided when creating a domain according to your actual needs and set appropriate cache rules.
-
You can enter the domain configuration details page and select Domain Name Configuration → Basic Settings → Cache Configuration → Modify cache rules to configure the cache related to the corresponding domain.
Default Cache Rules:
If the acceleration type is: Page
The default cache rules are:
1. The cache rules first follow the source station configuration. If the source station has no cache rules, then the following default cache rules are followed
2. Dynamic files: (php|aspx|asp|jsp|do|dwr|cgi|fcgi|action|ashx|axd|json) are not cached
3. All other files are cached for 30 days.
4. If the source station returns response header information: no-cache, no-store, then it is not cached.
If the acceleration type is: Download/On-demand
The default cache rules are:
1. All files are cached for 30 days, following the source station cache.
Parameter Cache Configuration
In the cache configuration of domain configuration, you can configure to retain or ignore parameter caching strategies. If you need to customize parameters, you need to contact technical support for non-standard configuration.
Default parameter caching rules:
If the acceleration type is: Page
Default with parameter caching
If the acceleration type is: Download/On-demand
Default without parameter caching
Domain Configuration:
Click on Configure Cache Rules to match and configure different website elements according to business needs, including removing parameter cache configuration.
After configuring and modifying the domain configuration, you must click Confirm Configuration to successfully modify the configuration.
Cache Configuration Item Description
Configuration Item | Description |
---|---|
Priority | |
Website Elements | |
Path Template | |
Cache Time | |
Whether to Cache | |
Whether to Follow the Origin Site |
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 in the root directory, /.*(html|js) represents all html and js type files in the root directory
7. The slash at the beginning /news/image.jpg represents the specific image.jpg file in the news directory, news(image.jpg|logo.jpg) represents the image.jpg and logo.jpg files in the news directory