Cert++
Close

Choosing a caching layer for a performance requirement

Key Takeaway

Cache each result at the highest layer that can safely hold it. If a page or remote include must stay dynamic, put its expensive shared work in a custom cache at the application server layer, and fill the cache with Cache.get(key, loader).

Caching in B2C Commerce stores a result so later requests don't have to rebuild it. The platform offers a different cache at each architectural layer. A developer meets a performance requirement by picking the highest layer that can safely hold the data, because every extra layer a request passes through adds response time and lowers how much traffic the site can handle.

The caching layers

A request can be answered at five layers. They form a ladder from the shopper down to the database:

  1. The shopper's browser
  2. The CDN
  3. The web server
  4. The application server
  5. The storage layer (database)

An efficient caching strategy moves cached content as high up this ladder as it can, because each layer a request traverses makes responses slower and lowers throughput.

Inside the platform, each server layer has its own caching method.

LayerCaching method
Web serverPage cache
Application serverCustom caches (CacheMgr)
Storage layerCustom attributes or custom objects
B2C Commerce Developer Study Guide

Checklist progress

0/237Learned

Given a problem or performance issue and data, use relevant tools to inspect code performance and determine and implement solutions (cache configuration, profilers, etc.) to resolve this issue

0/11

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other B2C Commerce Developer studiers. 796 members and growing.