Purging assets

There are several ways that assets can be purged using the Dynamic Media App, by purging selected assets one at a time, purging asset variants using the purge path function or purging all assets for an account.

The Dynamic Media app

Purging functionality is available from the Dynamic Media app. If the app is not available on your account, please contact your Customer Success Manager.

CDNs place limits on the number of purge requests to be made and as such each account has a monthly allocation of purge credits. These limits are as follows:

  • 1 account purge

  • 120 asset purges

  • 10 path purges

Each type of purge will use up one purge credit. You will be warned before starting a purge that it will reduce your credits.

Purging an asset

Purging will remove the asset from the cache of all the CDN edge servers. The time required to purge an asset can vary according to a number of factors, including:

  • Assets may be cached across multiple CDNs

  • Assets may still be cached in a user's browser cache and the browser cache TTL can vary between users and browsers

  • The amount of network traffic across each CDN

When the asset has been purged, the next request for that asset will take longer, since it will first request the latest version from the mid-tier CDN. If it's not found in the mid-tier CDN cache, then the asset will be requested from the origin servers.The asset is then cached on the CDN edge servers so that subsequent requests are handled faster.

To purge an asset, select the asset from the list in the Dynamic Media app and choose "Purge" from the menu on the right. Assets are purged one at a time and each request will use one of your purge credits. The use cases for using purge include replacing an asset with a newer version and completely deleting an asset from the CDN.

Replacing an asset with a newer version

In this case, a new version of an asset is available (perhaps the wrong version has been published) and you want to ensure that this is served to the user as soon as possible. The newer version of the asset is uploaded to Content Hub, replacing the existing version. It is then published. You then select the asset from the list in the Dynamic Media app and choose the "Purge" item from the menu to the right of the asset. The asset will then be removed from the CDN cache and when the purge is complete the newer version of the asset will be served to the user.

This use case is shown in more detail below.

We upload an asset named "armchairpurgetest", an image of a red armchair, to Content Hub. We can either publish this asset from Content Hub or from within the Dynamic Media App. When an asset is published, it is made available to serve from the Dynamic Media server (the origin server). When you choose "Toggle Preview" the version uploaded to Content Hub and the version on the origin server will be the same, in this the preview of the asset is the red armchair image.

Choosing toggle preview will show the version uploaded to Content Hub and the one on the origin server. In this case they are the same.
Choosing toggle preview will show the version uploaded to Content Hub and the one on the origin server. In this case they are the same.

Let's say that instead of using an image of a red armchair, we wanted to use a green armchair instead. Rather than wait up for 24 hours for the updated image to be available we want to use the purge function to make it available faster. We upload the green armchair image to Content Hub and publish it. Then we launch the Dynamic Media App, select the "armchairpurgetest" asset and choose "Toggle Preview" and can see that the asset image is now the green armchair.

The green armchair image has been uploaded to Content Hub and published. Now choosing toggle preview will show the green armchair in both images.
The green armchair image has been uploaded to Content Hub and published. Now choosing toggle preview will show the green armchair in both images.

However, the red armchair image will be cached on the CDN edge servers until the TTL expires, which could be up to 24 hours. So if we request the asset in a browser, the red armchair image will be retrieved from the CDN.

The previous armchair image is still cached, so the red armchair will be retrieved when we load the image URL in the browser.
The previous armchair image is still cached, so the red armchair will be retrieved when we load the image URL in the browser.

To purge the asset from the CDN, select it in the list and choose "Purge".

Choose purge to purge an image from the CDN cache.
Choose purge to purge an image from the CDN cache.

Purging an asset uses one of your purge credits and a warning dialog will be displayed asking if you want to continue.

Purging an asset will use up one of your purge credits
Purging an asset will use up one of your purge credits

Purging will remove the asset from the cache of all the CDN edge servers, although the time that this takes to complete will depend on a number of factors, as explained above.

When the asset has been purged, the next request for that asset will request the updated version from the origin servers. So in this case, when the asset purge is complete, the green armchair will be displayed. You may still need to clear the browser cache in order for the new image to be loaded.

The updated version of the image is now loaded.
The updated version of the image is now loaded.

Removing an asset

This refers to the case where want to completely remove an asset from the CDN cache without waiting for the TTL to expire. Removing an asset is a two step process. The asset will still be available in Content Hub, it just won't be available to serve to the user.

  1. Unpublish the asset, by selecting it in the list in the Dynamic Media app and choosing "unpublish". Unpublishing an item will remove it from the mid-tier CDN cache as well as the origin servers. The asset will not be automatically purged from CDN edge servers.

  2. Purge the asset from the CDN edge cache, by selecting the asset in the list and choosing "Purge". When the purge is complete, any request for the asset will fail since unpublishing the asset has removed it from the mid-tier cache and the origin.

When an asset is purged, all the derivatives of that asset will be purged as well. This is explained in more detail below.

Note that simply deleting an asset from Content Hub will not unpublish the asset or remove it from the CDN.

Sets

Adding ".jpg", ".png" or other image format to the URL of a set will return a preview image created from the first image or video that the set contains. This makes it easier to ensure that an image is always available to represent a product. For example:

http://i1.adis.ws/s/ampevalmaster/armchair_set.jpg

will return a JPEG created from the first element of the set.

Because this preview image is created using the URL of the set, and not the URL of an individual asset within the set, the image will only be purged when the set itself is purged. So, if the individual elements of the set have been updated, you will need to purge both the updated assets and the set itself.

Variants of an Asset

The Dynamic Media service allows you to manipulate images "on the fly", transforming an image with parameters including size and resolution, to create a version of an image appropriate for a particular device or to use as a thumbnail, for example. These derivatives of an image are created by adding parameters to the image URL. In the case of the armchair asset, we could create a version with a width of 300 pixels using the following URL:

http://i1.adis.ws/i/ampevalmaster/armchairpurgetest?w=300

The first time the armchair asset with these parameters is requested, a new variant of the asset will be cached on the CDN. The asset may be used in several places with different parameters and many variants of any given asset may be cached on the CDN.

A group of parameters can also be included in a transformation template.

Rather than adding the parameters directly to the URL:

http://i1.adis.ws/i/ampevalmaster/armchairpurgetest?qlt=15&w=600

These parameters qlt=15&w=600 might be included in a transformation template named "exampletemplate" and referred to as follows:

http://i1.adis.ws/i/ampevalmaster/armchairpurgetest?$exampletemplate$

All of the variants of an asset, whether generated directly by adding parameters to the URL or by using a transformation template, will be purged from the CDN cache when the asset itself is purged.

Purging a Path

The Dynamic Media app allows you to purge one or more individual URLs rather than purging all derivatives of an asset. For example, you may have made a change to a transformation template and don't want to purge all variants of an asset created using that template. You might also be using multiple transformation templates and only want to purge the derivatives of a particular asset created from one template.

To purge a path, choose the "Purge Path" item from the menu on the right hand side of the app window.

Choose purge path to purge selected variants of an asset.
Choose purge path to purge selected variants of an asset.

Enter the path to purge. The path must be specified using a partial rather than a full path. For example, to purge specified derivatives of the armchairpurgetest asset you would enter the following:

/i/ampevalmaster/armchairpurgetest

Purging a path will use one of your purge path credits. Paths can be added line by line, separated with a return character, with a maximum of 20 lines included in each request.

A detailed example of a path purge is shown below.

If we wanted to purge only the derivatives of the armchairpurgetest with the widths of 600 and 900 then we could enter

/i/ampevalmaster/armchairpurgetest?w=600
/i/ampevalmaster/armchairpurgetest?w=900
Purging all derivatives of the armchairpurgetest asset
Purging all derivatives of the armchairpurgetest asset

Alternatively we can choose the "Apply Suffixes" button and enter the parameters on separate lines in the "Add Suffixes" window.

Purging variants of the armchair image.
Purging variants of the armchair image.

Clicking the "Apply" button will append the parameters to the path we entered previously.

Click "Purge Path". The specified paths will now be purged.

Using add suffix to specify paths to purge.
Using add suffix to specify paths to purge.

Account purging

An account purge will remove from the CDN cache all the cached assets for this account, including images, sets and video. The cache will be completely cleared of all assets, so the next asset request will be slower, since the CDN will fetch each asset from the origin servers and then cache the assets on the mid tier CDN and CDN edge servers. An account purge should only be required in exceptional circumstances. However, it does guaranteed that the cache is completely cleared and the latest version of all assets will be retrieved when the user requests them.

To perform an account purge, launch the Dynamic Media app and choose "Purge Account" from the menu on the right hand side of the window.

Choose purge account to purge all assets in an account.
Choose purge account to purge all assets in an account.

By default you have one account purge credit per month and a whole account purge will use up this credit.

Account purge will use up your account purge credit.s
Account purge will use up your account purge credit.s

To continue and purge all the assets from the CDN cache, click the "Purge Whole Account" button.

Dynamic Media App

Caching

results matching ""

    No results matching ""