SCDN common cache file suffixes
Set up cache with reference to common resource extensions, and verify personalized content exclusion, resource updates and actual cache effects.
Contents of this article
The suffix is a clue to identify the resource, and it does not mean that such files can be cached publicly. Before operating, first determine whether the content is public, whether it changes with logged-in users, and how often it is updated.
Commonly used static files
.css,.js,.txt,.iso,.img,.exe,.zip,.rar,.7z,.gz,.tar,.apk,.ipa,.dmg,.manifest,.conf,.xml,.cab,.bin,.msi
Image files
.jpg,.jpeg,.gif,.ico,.png,.bmp,.webp,.psd,.tif,.tiff,.svg,.svgz
Commonly used audio and video
.mp3,.flv,.swf,.wma,.wav,.mp4,.mov,.mpeg,.rm,.avi,.wmv,.mkv,.vob,.rmvb,.asf,.mpg,.ogg,.m3u8,.ts,.mid,.midi,.3gp
Commonly used documents and fonts
.doc,.pdf,.csv,.ppt,.docx,.xlsx,.xls,.pptx,.ttf,.chm,.woff,.ps,.class,.jar,.woff2
These are file type references and are not recommended caching whitelists for all to be enabled. Even if configuration files, exported reports, paid downloads and private documents match the above suffix, they may contain private information or require authentication and should not be directly added to the public cache.
Web pages and dynamic content
The following web page files may return dynamic content and are not suitable for setting public caches uniformly:
.html,.htm,.php,.json
Public and content-fixed HTML or JSON can be evaluated individually after explicitly updating the policy; personalized responses such as login status, user profiles, orders, shopping carts, and business APIs should be explicitly excluded from public caching.
Turn type references into actual rules
in SCDN console Check the cache field, matching syntax and rule priority of the current website, and then configure the following items.
| Need to check | Operational points |
|---|---|
| Match syntax | Read the current field prompt first to confirm whether to use extensions, paths, or regular expressions, as well as delimiter and leading dot requirements; do not blindly paste the above comma list into other syntax fields |
| Cache scope | Only resources confirmed to be publicly shareable are covered; authenticated downloads, user exports and dynamic interfaces are separately excluded. |
| Cache time | According to the publishing frequency and acceptable old content duration settings, record the refresh method after the resource is updated. |
| URL parameters | Determine whether the parameters change the content or permissions; parameters that will change the content cannot be ignored at will. |
| Origin response header | Check Cache-Control、Vary、Set-Cookie and actual response to confirm that CDN rules do not cover business requirements |
| Rule priority | Check whether the exclusion rule will be overridden by a broader cache rule, save it and confirm with a real request |
For login and sensitive interfaces, don't rely solely on URL suffixes, and don't assume that carrying Cookie or Authorization will automatically bypass caching. The origin server can be used according to business private、no-store Other policies need to be confirmed to take effect on the CDN side.
Audio and video lists, fragments, authentication links and segment requests have their own update and permission requirements. It is not appropriate to rely solely on .m3u8、.ts、.mp4 The suffix applies the same time. First use the player to verify full playback, dragging, and expired link behavior.
Verify cache is correct
- Prepare three types of samples: A public static resource, a post-login page or interface, and a resource that uses parameters to distinguish content.
- Repeat the real request: Compare the content, status code and response header; if the platform provides cache records or hit identifiers, combine them with the origin server access log to determine. A single access being faster does not alone prove a cache hit.
- Check account isolation: Use two test accounts to access the same path, confirm that their data is correct, and then log out and retest. Don’t use sensitive data from real customers for testing.
- Verify release updates: Update a test resource, perform the refresh operation provided by the current console or use a new resource version address, and then check for new content from different networks.
- Record results: Save the test time, URL, rules and results; if there is still old content after refreshing, you should also check the browser cache and other proxy layers respectively.
If it is found that personalized content is cached, immediately stop the relevant cache and refresh it appropriately, check the affected scope, then adjust the rules and retest. Don't just wait for the cache to expire naturally.
Access and API exceptions see SCDN complete access and troubleshooting, see daily configuration CDN website management. When the rules cannot be confirmed, you can carry the redacted URL, response header and current actual configuration through Online technical support Check.
