I have a Strapi application that I’ve dockerized and I’m trying to implement Redis caching for better performance. However, I’m facing issues with the Redis connection. I’ve configured the Redis settings in my plugins.js file as follows:
module.exports = {
redis: {
config: {
connections: {
default: {
connection: {
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT || 6379,
db: process.env.REDIS_DB || 0,
},
settings: {
debug: false,
},
},
},
},
},
"rest-cache": {
config: {
provider: {
name: "redis",
options: {
max: 32767,
connection: "default",
},
},
strategy: {
enableEtagSupport: true,
logs: true,
clearRelatedCache: true,
maxAge: 3600000,
contentTypes: [
"api::activity.activity",
{
contentType: "api::activity.activity",
maxAge: 3600000,
hitpass: true,
keys: {
useQueryParams: true,
useHeaders: ["accept-encoding"],
},
method: "GET",
}
],
},
},
},
};
Is there anything specific I need to consider when using Redis caching with a Dockerized Strapi application?
How can I verify that my Strapi container can reach the Redis container within the Docker network?
Are there any additional configurations required to enable Redis caching properly in Strapi?
Any help or suggestions on how to troubleshoot and resolve this Redis connection issue in my Dockerized Strapi application would be greatly appreciated. Thank you!
I dockerized my Strapi application successfully, and the container is up and running without any issues. The strapi says connect to redis: (https://i.stack.imgur.com/ILiz9.png)
But there are no log in redis:(https://i.stack.imgur.com/okQ0D.png)