Skip to content

Commit 76f9da5

Browse files
authored
docs: Caching Module (medusajs#13701)
* standard docs for caching module + deprecated cache module * added guides for creating + using, and overall changes from cache to caching * fix details related to redis provider * fix build errors * fix build error * fixes * add guides to sidebar * add sidebar util * document query + index * moved cache tag conventions * fix build errors * added migration guide * added memcached guide * fixes * general fixes and updates * updated reference * document medusa cache * small fix * fixes * remove cloud cache * revert edit dates changes * revert edit dates * small update
1 parent eefda0e commit 76f9da5

File tree

50 files changed

+10530
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10530
-145
lines changed

www/apps/book/app/learn/configurations/medusa-config/page.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ The value of this configuration is prepended to `sess:`. For example, if you set
701701

702702
<Note>
703703

704-
This configuration is not used for modules that also connect to Redis, such as the [Redis Cache Module](!resources!/infrastructure-modules/cache/redis).
704+
This configuration is not used for modules that also connect to Redis, such as the [Redis Caching Module Provider](!resources!/infrastructure-modules/caching/providers/redis).
705705

706706
</Note>
707707

@@ -719,9 +719,9 @@ module.exports = defineConfig({
719719

720720
### redisUrl
721721

722-
The `projectConfig.redisUrl` configuration specifies the connection URL to Redis to store the Medusa server session. When specified, the Medusa server uses Redis to store the session data. Otherwie, the session data is stored in-memory.
722+
The `projectConfig.redisUrl` configuration specifies the connection URL to Redis to store the Medusa server session. When specified, the Medusa server uses Redis to store the session data. Otherwise, the session data is stored in-memory.
723723

724-
This configuration is not used for modules that also connect to Redis, such as the [Redis Cache Module](!resources!/infrastructure-modules/cache/redis). You'll have to configure the Redis connection for those modules separately.
724+
This configuration is not used for modules that also connect to Redis, such as the [Redis Caching Module Provider](!resources!/infrastructure-modules/caching/providers/redis). You'll have to configure the Redis connection for those modules separately.
725725

726726
<Note>
727727

@@ -764,7 +764,7 @@ The `projectConfig.sessionOptions` configuration defines additional options to p
764764

765765
<Note>
766766

767-
This configuration is not used for modules that also connect to Redis, such as the [Redis Cache Module](!resources!/infrastructure-modules/cache/redis).
767+
This configuration is not used for modules that also connect to Redis, such as the [Redis Caching Module Provider](!resources!/infrastructure-modules/caching/providers/redis).
768768

769769
</Note>
770770

www/apps/book/app/learn/deployment/general/page.mdx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,24 @@ So, add the following script in `package.json`:
120120

121121
## 3. Install Production Modules and Providers
122122

123-
By default, your Medusa application uses modules and providers useful for development, such as the In-Memory Cache Module or the Local File Module Provider.
123+
By default, your Medusa application uses modules and providers useful for development, such as the Local File Module Provider.
124124

125125
It’s highly recommended to instead use modules and providers suitable for production, including:
126126

127-
- [Redis Cache Module](!resources!/infrastructure-modules/cache/redis)
127+
- [Redis Caching Module](!resources!/infrastructure-modules/caching/providers/redis)
128128
- [Redis Event Bus Module](!resources!/infrastructure-modules/event/redis)
129129
- [Workflow Engine Redis Module](!resources!/infrastructure-modules/workflow-engine/redis)
130130
- [Redis Locking Module Provider](!resources!/infrastructure-modules/locking/redis)
131131
- [PostHog Analytics Module Provider](!resources!/infrastructure-modules/analytics/posthog) (If you're using analytics in your application. You can also use other analytics module providers that are production-ready).
132132
- [S3 File Module Provider](!resources!/infrastructure-modules/file/s3) (or other file module providers that are production-ready).
133133
- [SendGrid Notification Module Provider](!resources!/infrastructure-modules/notification/sendgrid) (or other notification module providers that are production-ready).
134134

135+
<Note>
136+
137+
The Caching Module was introduced in [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0) to replace the deprecated Cache Module.
138+
139+
</Note>
140+
135141
Then, add these modules in `medusa-config.ts`:
136142

137143
```ts title="medusa-config.ts"
@@ -141,9 +147,18 @@ module.exports = defineConfig({
141147
// ...
142148
modules: [
143149
{
144-
resolve: "@medusajs/medusa/cache-redis",
150+
resolve: "@medusajs/medusa/caching",
145151
options: {
146-
redisUrl: process.env.REDIS_URL,
152+
providers: [
153+
{
154+
resolve: "@medusajs/cache-redis",
155+
id: "caching-redis",
156+
is_default: true,
157+
options: {
158+
redisUrl: process.env.CACHE_REDIS_URL,
159+
},
160+
},
161+
],
147162
},
148163
},
149164
{

0 commit comments

Comments
 (0)