# Server caching with API policies

*MuleSoft Developer II Study Guide · Expose production-ready Anypoint Platform-managed APIs from Mule applications · Last updated November 7, 2026 · https://www.certifyforce.com/study-guide/mulesoft-developer-ii/expose-production-ready-anypoint-platform-managed-apis-from-mule-applications/server-caching-with-api-policies*

Configure gateway response reuse without confusing request identity, storage eligibility, persistence and expiration. Predict policy-chain behavior on cache hits and handle CloudHub-specific configuration changes.

- Certification: Salesforce MuleSoft Developer II
- Exam section: Expose production-ready Anypoint Platform-managed APIs from Mule applications
- Study guide: https://www.certifyforce.com/study-guide/mulesoft-developer-ii

**Official exam objective:**

> Implement server-side caching of API invocations using API policies.

## What the exam expects

- Place gateway caching correctly relative to policies required on every request.
- Choose a cache key and separate request eligibility from response eligibility.
- Interpret caching directives without confusing lookup, storage and invalidation.
- Select distribution and persistence for the stated deployment option.
- Change expiration configuration using the documented CloudHub procedure.

**Cache key** identifies a reusable response; **cache hit** finds that response; **cache miss** requires backend processing; **TTL** bounds entry lifetime; **distributed cache** shares entries across nodes; **persistent cache** preserves entries across runtime restarts ([HTTP caching](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching)).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Policy placement | Controls needed on hits belong before HTTP Caching. | [Cache behavior](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Default identity | The key expression uses `attributes.requestPath`. | [Caching parameters](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Request versus response | Method eligibility does not determine which response statuses are stored. | [Conditions](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Negative results | The default response status list includes 404. | [Defaults](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Request no-store | Blocks new storage without necessarily bypassing an existing entry. | [Directives](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Response private | Prevents the returned response from being stored. | [Directives](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| CloudHub sharing | Distributed uses Object Store v2 and is persistent. | [Deployment FAQ](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| Invalidation commands | The configured header accepts `invalidate` or `invalidate-all`. | [Invalidation](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |
| CloudHub TTL update | Replace the caching policy when editing TTL is not reflected with Object Store v2. | [TTL FAQ](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching) |

## Check yourself

- Why should a rollout plan allow for cache repopulation after upgrading an instance that uses persistent caching?
- When a response has no Date header, what origin time does the policy add?
- What happens when evaluating a request's cache key fails?

## Sources

- [HTTP Caching Policy](https://docs.mulesoft.com/mule-gateway/policies-included-http-caching)
- [Apply a Policy](https://docs.mulesoft.com/mule-gateway/policies-included-apply)
- [Cache Scope for Mule 4.6](https://docs.mulesoft.com/mule-runtime/4.6/cache-scope)

## About the full unit

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