docs: change Medusa Cache setup information (#13802)
This commit is contained in:
1 parent
2d1d51a2af
commit
a540256137
2 files changed
+29
-28
No files matched your search
Vendored
+28
-27
@@ -18,12 +18,34 @@ Medusa Cache relies on the existing key/value [Redis](../redis/page.mdx) store a
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Enable Medusa Cache
|
||||||
|
|
||||||
|
<Prerequisites
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
text: "Medusa v2.11.0+",
|
||||||
|
href: "https://github.com/medusajs/medusa/releases/tag/v2.11.0",
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
To enable Medusa Cache for your Medusa project deployed on Cloud, set the `caching` feature flag in `medusa-config.ts`:
|
||||||
|
|
||||||
|
```ts title="medusa-config.ts"
|
||||||
|
module.exports = defineConfig({
|
||||||
|
// ...
|
||||||
|
featureFlags: {
|
||||||
|
caching: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
This will enable all Medusa Cache functionality in your project.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## How Does Medusa Cache Work?
|
## How Does Medusa Cache Work?
|
||||||
|
|
||||||
### Enabled by Default
|
|
||||||
|
|
||||||
Medusa Cache is enabled by default for all environments and plans if your Medusa project is running [Medusa v2.11.0 or later](https://github.com/medusajs/medusa/releases/tag/v2.11.0). No configuration is required to start using caching.
|
|
||||||
|
|
||||||
### Cached Data in API Routes
|
### 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:
|
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:
|
||||||
@@ -38,9 +60,7 @@ By using Medusa Cache, data is cached across several business-critical APIs to b
|
|||||||
|
|
||||||
### Integrated into Query
|
### Integrated into Query
|
||||||
|
|
||||||
{/* Medusa Cache is built on the new [Caching Module](!resources!/infrastructure-modules/caching). The module has been integrated into [Query](!docs!/learn/fundamentals/module-links/query) so that `query.graph` calls can be cached easily. */}
|
Medusa Cache is built on the new [Caching Module](!resources!/infrastructure-modules/caching). The module has been integrated into [Query](!docs!/learn/fundamentals/module-links/query) so that `query.graph` calls can be cached easily.
|
||||||
|
|
||||||
Medusa Cache is built on the new [Caching Module](#). The module has been integrated into [Query](!docs!/learn/fundamentals/module-links/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:
|
You can enable caching for your custom `query.graph` calls by passing a `cache` option. For example:
|
||||||
|
|
||||||
@@ -63,9 +83,7 @@ This code caches the query result. When the same query is made again, the cached
|
|||||||
|
|
||||||
By default, data is cached for one hour or until invalidated. Invalidation occurs automatically when related data is created, updated, or deleted.
|
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](!resources!/infrastructure-modules/caching/concepts#automatic-cache-invalidation). */}
|
Learn more about automatic invalidation in the [Caching Module documentation](!resources!/infrastructure-modules/caching/concepts#automatic-cache-invalidation).
|
||||||
|
|
||||||
Learn more about automatic invalidation in the [Caching Module documentation](#).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -323,20 +341,3 @@ The following benchmark comparisons demonstrate the performance improvements you
|
|||||||
</Table.Row>
|
</Table.Row>
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Opt-Out of Medusa Cache
|
|
||||||
|
|
||||||
If you want to disable Medusa Cache for your Medusa project, you can do so by disabling the `caching` feature flag in `medusa-config.ts`:
|
|
||||||
|
|
||||||
```ts title="medusa-config.ts"
|
|
||||||
module.exports = defineConfig({
|
|
||||||
// ...
|
|
||||||
featureFlags: {
|
|
||||||
caching: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
This will disable all Medusa Cache functionality in your project.
|
|
||||||
@@ -24,6 +24,6 @@ export const generatedEditDates = {
|
|||||||
"app/sign-up/page.mdx": "2025-10-08T14:40:47.993Z",
|
"app/sign-up/page.mdx": "2025-10-08T14:40:47.993Z",
|
||||||
"app/comparison/page.mdx": "2025-09-30T06:17:40.257Z",
|
"app/comparison/page.mdx": "2025-09-30T06:17:40.257Z",
|
||||||
"app/billing/plans/page.mdx": "2025-10-08T14:49:27.009Z",
|
"app/billing/plans/page.mdx": "2025-10-08T14:49:27.009Z",
|
||||||
"app/cache/page.mdx": "2025-10-15T06:31:14.375Z",
|
"app/cache/page.mdx": "2025-10-21T14:27:54.005Z",
|
||||||
"app/deployments/troubleshooting/page.mdx": "2025-10-17T14:44:22.894Z"
|
"app/deployments/troubleshooting/page.mdx": "2025-10-17T14:44:22.894Z"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user