- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Redis Cache Module
The Redis Cache Module uses Redis to cache data in your store. In production, it's recommended to use this module.
Register the Redis Cache Module#
Add the module into the modules
property of the exported object in medusa-config.ts
:
Environment Variables#
Make sure to add the following environment variables:
Redis Cache Module Options#
Option | Description | Required | Default |
---|---|---|---|
| A string indicating the Redis connection URL. | Yes | - |
| An object of Redis options. Refer to the Redis API Reference for details on accepted properties. | No | - |
| The number of seconds an item can live in the cache before it’s removed. | No |
|
| A string used to prefix all cached keys with | No |
|
Test the Module#
To test the module, start the Medusa application:
You'll see the following message in the terminal's logs:
Terminal❯Connection to Redis in module 'cache-redis' established
Was this page helpful?