B2C Commerce stores static storefront content in eCDN cache or the web tier static
content cache.
All content cached by eCDN is served using a unique URL. Cache purging a CDN on top of URLs
from B2C Commerce is not necessary, because the system updates the URL when uploading new
content. Aside from replicating environments to clear the cache of any static content, no
action is required.
When working with eCDN cache, keep the following in mind:
- eCDN uses the Cache-Control header to persist a file in cache until that TTL expires.
After the cache header expires, eCDN retrieves the new resource. eCDN caches based on the
value set by the cache headers. If these headers are not set, the default value of 30 days
is enforced.
-
The web adapter configures web pages using static assets from both eCDN and web tier
cache sources. Regardless of the cache location, web tier or eCDN, each static content
asset on your storefront is assigned a fingerprint value. For example, consider the
following URL:
https://www.samplecustomer.com/dis/dw/image/v2/XXXX_PRD/on/demandware.static/-/Sites-customer-master/default/dwabb3a337/images/hi-res/shoes.jpg?sw=200=200=fitm=png>
.
The value dwabb3a337
is the asset fingerprint. The fingerprint
provides a unique identifier for the asset.
- Updates to static cache occur at intervals you set. If necessary, you can update an
asset held in static cache before the cache interval expiration. The process does not
require cache to be cleared, and can be completed without requesting a support
ticket.
To clear eCDN cache:
-
Upload the updated asset to your storefront POD.
When an asset is updated on the POD, the system generates a new fingerprint
value for that asset. Changing the fingerprint also changes the URL of the updated asset.
When your storefront requests the updated static asset, the URL request returns a miss in
eCDN and web tier cache. This response occurs because the fingerprint is different, and
the CDN does not recognize the new and old asset as the same. The missed request with the
new fingerprint is then directed to the POD, the asset is then retrieved and cached with
the new URL.
Note: All content assets in cache are refreshed, excluding the old content
updated in this process. The update content is assigned a new fingerprint that results
in a new URL for the asset.
-
Refresh your site in the browser and confirm that the updated asset appears as
expected.
If the updated asset does not appear in your browser after updating content, you can
manually invalidate the Application Tier cache. Though it is rare, the asset not appearing
means that something went wrong with the cache clearing process.
- In determine level, page, or storefront, for which you want to clear the
cache, and click Invalidate cache.
The system rebuilds cache from
the POD assets, and assigns new fingerprints to the updated assets.
- Refresh the site in your browser, and confirm that the updated asset appears as
expected.