From a540256137e7effd92bac6b1bb02b179a61394a4 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 21 Oct 2025 17:31:56 +0300 Subject: [PATCH] docs: change Medusa Cache setup information (#13802) --- www/apps/cloud/app/cache/page.mdx | 55 +++++++++++++------------ www/apps/cloud/generated/edit-dates.mjs | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/www/apps/cloud/app/cache/page.mdx b/www/apps/cloud/app/cache/page.mdx index def3683299..cdc0daee0c 100644 --- a/www/apps/cloud/app/cache/page.mdx +++ b/www/apps/cloud/app/cache/page.mdx @@ -18,12 +18,34 @@ Medusa Cache relies on the existing key/value [Redis](../redis/page.mdx) store a --- +## Enable Medusa Cache + + + +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? -### 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 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 -{/* 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. +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. 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. -{/* 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](#). +Learn more about automatic invalidation in the [Caching Module documentation](!resources!/infrastructure-modules/caching/concepts#automatic-cache-invalidation). --- @@ -323,20 +341,3 @@ The following benchmark comparisons demonstrate the performance improvements you - ---- - -## 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. \ No newline at end of file diff --git a/www/apps/cloud/generated/edit-dates.mjs b/www/apps/cloud/generated/edit-dates.mjs index 310af38c04..729d0b370e 100644 --- a/www/apps/cloud/generated/edit-dates.mjs +++ b/www/apps/cloud/generated/edit-dates.mjs @@ -24,6 +24,6 @@ export const generatedEditDates = { "app/sign-up/page.mdx": "2025-10-08T14:40:47.993Z", "app/comparison/page.mdx": "2025-09-30T06:17:40.257Z", "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" } \ No newline at end of file