# Code Profiler, page cache and custom caches

*B2C Commerce Developer Study Guide · Data Management Using Business Manager Usage · Last updated November 3, 2026 · https://www.certifyforce.com/study-guide/b2c-commerce-developer/data-management-using-business-manager-usage/code-profiler-page-cache-and-custom-caches*

Which profiler answers which performance question, how the page cache is invalidated (15-minute clear period, partitions, remote includes), when to use relative cache times and varyby, and how to register and use a custom cache with CacheMgr.

- Certification: Salesforce B2C Commerce Developer
- Exam section: Data Management Using Business Manager Usage
- Study guide: https://www.certifyforce.com/study-guide/b2c-commerce-developer

**Official exam objective:**

> 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.

## What the exam expects

- Pick the Pipeline Profiler or a Code Profiler mode for a performance question, and read its data correctly.
- Explain what invalidates the page cache, why repeated invalidation backfires, and how partitions and remote includes interact.
- Replace a daily cache expiry with relative cache times, and mark price- and promotion-dependent pages with `varyby="price_promotion"`.
- Register a custom cache and use `Cache.get(key, loader)`, knowing what can and can't be stored.

Key terms: **Pipeline Profiler** (Business Manager view of hits, total and average time per controller and script); **Code Profiler** (run-time profiler with three modes and exportable data); **page cache** (web server copies of pages built from ISML templates); **clear period** (the 15 minutes over which an invalidation evicts the cache); **page cache partition** (a group of pipelines invalidated together); **custom cache** (a cartridge-registered key-value cache read through `CacheMgr`).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| First tool after a release | Pipeline Profiler: high average time plus high hits | [Troubleshooting Salesforce B2C Commerce Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-troubleshooting-platform-performance.html) |
| Production Mode | Default on non-sandbox instances, can't be deactivated | [Site Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-site-performance.html) |
| Development Mode | Default on sandboxes, all requests | [Site Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-site-performance.html) |
| Code Profiler data | Per application server; exported hourly to CSV, then reset | [Site Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-site-performance.html) |
| Clear period | 15 minutes; each new invalidation resets it | [Content Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-content-cache.html) |
| Partition limits | 10 partitions, 20 pipelines each, one partition per pipeline | [Content Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-content-cache.html) |
| Remote includes | Not invalidated with the containing pipeline | [Content Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-content-cache.html) |
| `daily` time zone | GMT | [iscache Element](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-iscache.html) |
| `varyby` value | `price_promotion` only | [iscache Element](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-iscache.html) |
| Cache registration | `caches` entry in the cartridge's `package.json` | [Class CacheMgr](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.CacheMgr.html) |
| Loader returns `undefined` | Nothing is stored | [Class Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Cache.html) |

## Check yourself

- When does the Pipeline Profiler stop supplying script-level data?
- Why must you reproduce the slow behaviour on a sandbox after switching Code Profiler modes?
- What does calling put with an undefined value do to a custom cache entry?
- Why should the cache settings be replicated to production only when the partitions change?

## Sources

- [Site Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-site-performance.html)
- [Troubleshooting Salesforce B2C Commerce Performance](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-troubleshooting-platform-performance.html)
- [Content Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-content-cache.html)
- [iscache Element](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-iscache.html)
- [Class CacheMgr](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.CacheMgr.html)
- [Class Cache](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-script-api/dw.system.Cache.html)
- [Monitor Code](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/code-profiler.html)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 9 linked practice questions, and unlimited timed mock exams are included with the B2C Commerce Developer pack (USD $19): https://www.certifyforce.com/practice-exams
