AssetUrlFilters

Version 0.9.1+

Encourages use of asset_url or img_url filters to serve assets. You should deliver as much as you can from the Shopify content delivery network (CDN). Using the same host for your assets avoids unnecessary HTTP connections and allows the server to prioritize the delivery of blocking resources using HTTP/2 prioritization. Learn more about hosting assets on Shopify servers.

Examples

Below are examples of code that fails and passes this check.

✗ Fail

In this example, the size of assets/theme.css is greater than threshold_in_bytes.

In this example, a resource is retrieved from a non-Shopify CDN.

In this example, an image tag is used without an img_url filter.

✓ Pass

These examples use the asset_url or img_url filters to load files from a theme's assets folder from the Shopify CDN:

Disabling this check

This check is safe to disable. You might disable this check when the remote content is highly dynamic.