Adobe Commerce on cloud infrastructure includes Fastly CDN and uses a different integration workflow. This procedure applies to Magento Open Source 2.x and on-premises Adobe Commerce.
1
Prepare the CDN resource
Configure the storefront hostname —
shop.example.com — as the CDN origin. Set the origin host header to the same hostname when the web server uses name-based virtual hosting.Activate cdn.example.com as the HTTPS custom domain. Confirm that known files under the storefront static and media paths return successfully through the CDN domain.The examples below assume that pub is the storefront document root, so the public paths begin with /static/ and /media/.2
Open the web configuration
Log in to the Commerce Admin and navigate to Stores > Settings > Configuration. Under General, select Web.In the Store View selector, select the website or store view that will use Gcore CDN. Select Default Config only when the URLs should apply to every scope that inherits the global values.
3
Configure the static and media URLs
Expand Base URLs and clear Use system value for these fields:
-
Base URL for Static View Files: Enter
https://cdn.example.com/static/. -
Base URL for User Media Files: Enter
https://cdn.example.com/media/.
-
Secure Base URL for Static View Files: Enter
https://cdn.example.com/static/. -
Secure Base URL for User Media Files: Enter
https://cdn.example.com/media/.
4
Save and refresh the cache
Click Save Config. Follow the Cache Management link in the confirmation message, or navigate to System > Tools > Cache Management and click Flush Magento Cache.Keep static content signing enabled because its deployment version changes static URLs after storefront deployments and prevents stale browser or CDN content.
5
Verify CDN delivery
Open the storefront and use the browser developer tools:
- Open the Network panel.
- Reload a page that contains product images, theme styles, and scripts.
-
Select requests under
/static/and/media/. -
Confirm that their URLs use
cdn.example.comand return successful responses.
Integration troubleshooting
When static or media files fail to load from the CDN domain, the cause is usually a document-root path mismatch, an origin protocol or host-header error, a configuration scope that still uses the storefront domain, or a cache that still serves the previous URL.- For a
404response, confirm whether the origin web root exposespub. If it does not, include/pub/in the CDN path or configure an equivalent origin rewrite. - For a
502response, verify the CDN origin pull protocol and host header. - If browser fonts are blocked, configure the origin to return an
Access-Control-Allow-Originheader forhttps://cdn.example.com. - If static or media URLs still use the storefront domain, verify the selected configuration scope and flush the Magento cache.
- If an updated asset remains stale, deploy static content with the normal Commerce release process and purge the affected CDN cache.