Skip to content

Documention says TTL is milliseconds but it's really seconds for Redis #124

Description

@molund

I think the documentation for "@strapi-community/plugin-rest-cache": "5.0.0", is wrong.
https://strapi-community.github.io/plugin-rest-cache/guide/provider/redis.html

ttl was set to 600000 and the Redis pods kept running out of memory and crashing. I changed it to 600 and it's behaving as expected. The docs says it’s milliseconds but it’s actually seconds, confirmed using ttl <key> with a stopwatch in redis-cli. (redis:6.2.20-alpine)

This seems to be an issue with version 5.0.0 of the plugin and I think it might only impact Redis, not memory.

      provider: {
        name: "redis",
        options: {
          // The name of the connection as defined in the Redis plugin.
          connection: "default",
          // The time to live in milliseconds. This is the maximum amount of time that an item can be in the cache before it is removed.
          ttl: 3600 * 1000
          // ...
        },
      },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions