When you enable Alibaba Cloud CDN acceleration on an Object Storage Service (OSS) bucket—or enable the image processing (IMG) feature—cross-origin resource sharing (CORS) rules configured on OSS may stop working.
Why this happens
CDN acceleration works by caching content on CDN nodes and serving it directly to users from those nodes. Once a file is cached, CDN nodes continue serving the cached version until it expires, regardless of changes made at the origin.
The same behavior applies to CORS configuration. If CDN acceleration is enabled or the image processing feature is enabled, accessed files are cached on CDN nodes. If you add or update a CORS rule on OSS after files are already cached, the nodes do not automatically pick up the new configuration. Responses served from the cache do not include the updated CORS headers, and the browser blocks the cross-origin request.
Solution
After you update the CORS configuration on your OSS bucket, refresh the URL cache in the CDN console so that the updated CORS configuration takes effect promptly.
Log on to the CDN console.
Choose Refresh and Preload > Refresh Cache.
Enter the URL of the affected resource and click Refresh.
Make sure that the HTTP header parameters are correctly configured. For details, see How to configure cross-origin resource sharing (CORS) and precautions.
Applicable scope
CDN
Object Storage Service (OSS)