CDN Caching

This topic applies to

Applies to

Commerce Web Stores

 

You can optimize your website and decrease page-loading time by caching data and site assets on the Content Delivery Network (CDN) available with Commerce web stores. After you set up CDN cache, data and site assets that are reused across your web store are always cached. Caching enables reused data and assets to be read quickly, increasing site performance.

To learn more about CDN Caching, refer to the following sections:

Items Cached

The following items are cached by the CDN:

  • All image files hosted in the file cabinet, identified by filename extensions such as, .gif, .jpg, .bmp, and .png, as well as static file system images that might be referenced from default site templates.

  • Content in the file cabinet, marked Available Without Login.

  • Static content (such as text) delivered from the file cabinet that does not contain custom Web Site tags.

  • The response output from the Item Search API. For example, a request to the Item Search API that returns a list of items.

  • The response output of executed SuiteScript hosted out of the file cabinet, if it sets response headers indicating the content is cacheable. This refers to SuiteScript associated with SSP applications.

  • SSP files

Note

Files stored in the file cabinet for sale as download items are excluded from the CDN cache.


CDN Caching Times

The length of time that a certain type of content is cached in the CDN also indicates the time it takes for returning customers to see updated content. Note the following:

Type of Content

Example

How long is it Cached?

Static Content

Images, CSS

7 days

Scripts

Scripts that are not dependent on the session

2 hours

Content Delivery

page.ss

5 minutes

You can use the Cache Invalidation Request form to clear the CDN cache, but the browser cache remains untouched. For example, when you invalidate a URL, new customers see new content right away, but returning customers see old content until it expires in their browser cache. If CDN is enabled, static content in the browser cache expires automatically every two hours. Visitors who return to the website more than two hours after their last visit must therefore request fresh data from the CDN cache. If the static data in the CDN cache has been manually or automatically refreshed in these two hours, the visitors receive the new website content from the CDN cache.

Limiting Cache

As you build your Commerce web store, it is important to see the changes you make in real time. After you set up CDN cache, you can use tools and strategies to ensure that you are looking at updated website content. For more information, read the following topics:

  • Bypass CDN Cache – Use this strategy for setting up a subdomain for testing changes to your website.

  • Cache Invalidation Request – Learn how to invalidate the cache for the whole domain or just the specified URLs.

  • Find URLs for Cache Invalidation – Learn how to locate specific URLs for cache invalidation requests. This topic also includes guidelines for sending cache invalidation requests for different types of website updates, such as banners and stylesheets.