Understanding the Changes to Asset URLs on Shopify

Understanding the Changes to Asset URLs on Shopify

Shopify Updates: 

Why Are Asset URL Changes Happening?

Shopify is transitioning some asset URLs to a new format to enhance storefront performance and security. This change involves serving store assets, such as images, JavaScript, and CSS, from a shop's domain rather than Shopify’s CDN domain. These adjustments are part of Shopify's commitment to improving the user experience and optimizing performance.

What's Changing?

Here’s a breakdown of the changes:

  • New URL Format: Storefront assets will now be served via the store's domain, such as shop.example.com/cdn/..., replacing the older cdn.shopify.com/... format for supported assets.
  • Liquid Tag Updates: Liquid tags will now return URLs in the new format for Shopify-rendered HTML on storefronts.
  • Headless Shops Excluded: Stores using headless architecture will continue to use cdn.shopify.com/....
  • Domain Context: Depending on the buyer's access point, the domain might be either the store's default myshopify.com domain or a custom domain.
  • Product Image Path Changes: New product images will use a /files path format instead of the older /products, though previously uploaded images will remain unaffected.

Benefits of the New Asset Delivery Approach

This update is designed with several advantages in mind:

  • Improved page load times, potentially speeding up storefronts by hundreds of milliseconds.
  • Enhanced security through more restrictive Content Security Policy (CSP) and Cross-Origin Resource Sharing (CORS) policies.
  • A cleaner storefront experience with less Shopify branding on merchant domains.

What Action Is Required?

  • Check your custom code to ensure it doesn’t rely on hard-coded references to the older cdn.shopify.com URL format.
  • Test your store to confirm that all assets load correctly under the new URL rules.

Key Points to Remember

The older URL format will continue to function indefinitely and in API responses, ensuring compatibility during this transition. However, updating your custom code will help your store leverage the benefits of the new system.

You can see the new format in action on Shopify’s demo store at www.snowdevil.ca.

Back to blog