Has anyone used Upstash with Strapi?

Having some trouble configuring the rest-cache plugin, connection is failing, but then there’s no docs to support the bearer token auth which Upstash is using.

Anyone been there done that?

Started writing a custom provider, but even then the docs are not complete.

Any help would be appreciated :slightly_smiling_face:

Thanks!

Peter

This topic has been created from a Discord post (1252249270300708935) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

In your plugins file the redis entry needs to appear before the rest-cache plugin does. I have posted my relevant configs for that as i use upstash no problem here

redis: {
    config: {
      connections: {
        default: {
          connection: {
            host: env("UPSTASH_URL"),
            port: env("UPSTASH_PORT"),
            db: 0,
            password: env("UPSTASH_TOKEN"),
          },
          settings: {
            debug: false,
          },
        },
      },
    },
  },
"rest-cache": {
    config: {
      provider: {
        name: "redis",
        options: {
          max: 32767,
          connection: "default",
          keepAlive: 86400000,
        },
      },
      strategy: {
        contentTypes: [
          "api::page.page",
          "api::post.post",
          "api::post-category.post-category",
        ],
      },
    },
  },

Thank you so much, yes I have it in thaty order, but your cfg should help a lot :slightly_smiling_face: