Medusa Cache
In this guide, you'll learn about Medusa Cache.
What is Medusa Cache?#
Medusa Cache is a caching layer that improves your application's performance and reduces costs. It's available to all environments and plans out of the box at no additional cost.
Medusa Cache relies on the existing key/value Redis store already provisioned for environments. Each environment has its own isolated cache.

Enable Medusa Cache#
To enable Medusa Cache for your Medusa project deployed on Cloud, set the caching feature flag in medusa-config.ts:
This will enable all Medusa Cache functionality in your project.
How Does Medusa Cache Work?#
Cached Data in API Routes#
By using Medusa Cache, data is cached across several business-critical APIs to boost performance and throughput. This includes all cart-related operations, where the following data is cached:
- Regions
- Promotion codes
- Variant price sets
- Variants
- Shipping options
- Sales channels
- Customers
Integrated into Query#
Medusa Cache is built on the new Caching Module. The module has been integrated into Query so that query.graph calls can be cached easily.
You can enable caching for your custom query.graph calls by passing a cache option. For example:
This code caches the query result. When the same query is made again, the cached result is returned instead of querying the database.

Automatic Invalidation#
By default, data is cached for one hour or until invalidated. Invalidation occurs automatically when related data is created, updated, or deleted.
Learn more about automatic invalidation in the Caching Module documentation.
Performance Benchmark Comparisons#
The following benchmark comparisons demonstrate the performance improvements you can expect with Medusa Cache. These were conducted on a Cloud environment with a standard setup.
Endpoint | Without Medusa Cache (ms) | With Medusa Cache (ms) | Improvement |
|---|---|---|---|
Product Operations | |||
|
|
|
|
|
|
|
|
|
|
|
|
Cart Operations | |||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Order Operations | |||
|
|
|
|
Other Operations | |||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|