Cache Invalidation in Specific Scenarios

The following guidelines describe how to invalidate caches in specific scenarios:

Note:

The URLs provided here are examples only. Check the exact URL for your implementation before you submit an invalidation request. For information about how to find the correct URL, see Find URLs for Cache Invalidation.

Updating Stylesheets

For optimum site performance, CSS stylesheets in Commerce websites are cached client-side for 7 days. You can submit a cache invalidation request to clear the CSS styles in CDN cache, but this does not clear client side browser cache of CSS styles. Therefore, when using cache invalidation to refresh CSS styles you must plan ahead to ensure both customers who have previously visited your site and new customers see the latest CSS changes.

For example, in two weeks you want to show a different color scheme on your website. Upload the new CSS defining the updated color scheme 7 days before you need it to go live. Then, submit a cache invalidation request for the URL of the current CSS file and URLs that reference the current CSS file.

To view updated CSS styles:

  1. Upload the new CSS file to the file cabinet.

  2. Use the Cache Invalidation by URL page to invalidate the cached CSS.

    1. In the Domain Name field, enter the website domain. For example: www.mywebstore.com.

    2. In the URL field, enter the URL for the CSS file. For example:

      /c.7654321/shopflow-1-05-0/skins/standard/Styles-012345a6789.css.

    3. Click Save.

Changing Product Details

Code implementing Item Search API requests is cached for 5 minutes. CDN invalidation takes about 7 minutes. However, you can use the Cache Invalidation by URL page to force an update.

  1. In the Domain Name field, enter the website domain. For example: www.mywebstore.com.

  2. In the URL field, enter the Item Search API request URL. For example:

    /api/items?id=199051&fieldset=search.

  3. Click Save.

Updating a Product Image

To update an image on your site, you do not need to use the Cache Invalidation by URL page. To view an updated image, you can check the Generate URL Timestamp box on the file record in the Web Site Hosting Files Folder.

Shows the checkbox to enable to view an updated image.

Checking this box forces the CDN to store a new version of your file. The file cabinet adds a URL time stamp based on the last date the file was modified. A new time stamp is generated each time the file changes. The URL time stamp indicates to the CDN and browser cache that the content has changed. For example, a new timestamp is generated each time you change an image used on a landing page or banner.

Best Practice: If you notice outdated images coming from the cache during website development, check the Generate URL Timestamp box on the file record. The search service reads the new URL, and the new version of the file is stored in the CDN cache.

Note:

This feature only applies to URLs that are returned using code that implements the Item Search API, such as product images.

Clearing Cached Site Management Tools Content

Site Management Tools (SMT) content is cached like any other content on your site. When new content is published SMT related caches are cleared. Cache clearing occurs for both immediate publication and scheduled publication.

The cache clearing task is specific to the account’s site ID so that only the caches for the site where content was published is cleared. Caches for any other site owned by the account are not cleared.

The caches that are cleared include:

  • Media Cache

  • Ignite Response Cache

  • Hosted Page Util Cache

  • CDN Cache

Related Topics

Cache Invalidation Request
Cache Invalidation Status
Automatic Cache Invalidation
Find URLs for Cache Invalidation
Cache Invalidation
CDN Caching

General Notices