All Tutorials

About content delivery networks (CDNs)

All Tutorials

About content delivery networks (CDNs)

About content delivery networks (CDNs)

CDN stands for content delivery network. Shopify provides merchants a world class CDN run by Fastly. Using a CDN means that your online store will load quickly around the globe, despite the Shopify servers being in North America.

You can read more about Fastly on the Fastly website.

Short delays for images in your store

Using a CDN means that all of your online store images are cached at thousands of servers around the world. When you make changes to your images, Shopify informs the CDN that the images have changed. To do this, Shopify uses the asset_url filter, which automatically appends version numbers to all of the urls it generates. For example, a version number appended to the end of a url might look like this: ?v=1384022871.

If you link to an image without using the asset_url filter and upload a new version of the same image, then the image on your online store might not change to the new version for a day or more.

CSS syntax to ensure automatic updates

If you reference an image directly in your CSS, then the url will be static and will not carry the asset version that Shopify updates automatically.

To make sure that your images are automatically updated, change your CSS syntax to include the asset_url filter.

For example, if your CSS looks like this:

background: url(bg.gif);

then change it to look like this:

background: url({{'bg.gif' | asset_url}});