> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Redis with Upstash

> Provision a free serverless Redis instance for caching website translations.

CAMB AI Website Translation uses Redis to cache translated text so visitors get instant page loads after the first visit. This guide walks you through creating a free Redis database on [Upstash](https://upstash.com) and wiring it up to your Website Configuration.

## 1. Sign up for Upstash

Navigate to [https://upstash.com](https://upstash.com).

<Frame caption="Figure 1 — Upstash landing page">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image1.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=ed38a28cbc0b7bf59c9bd9988ad8c5dd" alt="Upstash landing page" width="408" height="187" data-path="images/other-products/upstash/image1.png" />
</Frame>

Create an account using GitHub, Google, or email.

<Frame caption="Figure 2 — Upstash login page">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image2.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=824fe3e9e16b7552ba3b483febfd4dd7" alt="Upstash login page" width="468" height="84" data-path="images/other-products/upstash/image2.png" />
</Frame>

After signing in, you'll be directed to the **Upstash Console**.

<Frame caption="Figure 3 — Upstash Console">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image3.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=33eb5af9361ad9f10171e8d020f58e1e" alt="Upstash Console dashboard" width="468" height="214" data-path="images/other-products/upstash/image3.png" />
</Frame>

## 2. Create a new Redis database

From the dashboard, select **Redis** and then **Create Database**.

Configure the database:

* **Name** — Assign a descriptive name (for example, `project-cache-db`).
* **Region** — Select a region close to your application hosting location to minimize latency.
* **Plan** — Choose the free plan if you're testing or working on a small project.

<Frame caption="Figure 4 — Create Database">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image4.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=22afde5f2d0130f366ce6ea22a5a9fd0" alt="Create Database form" width="436" height="201" data-path="images/other-products/upstash/image4.png" />
</Frame>

<Frame caption="Figure 5 — Select a Plan">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image5.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=ea23a85b2ba3ecdc4799e19ab581d52c" alt="Plan selection screen" width="448" height="198" data-path="images/other-products/upstash/image5.png" />
</Frame>

Click **Create**. After a few seconds, your database will be available.

<Frame caption="Figure 6 — Redis database dashboard">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image6.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=aa1047a49fa392c361d93e7a7d7ab1d0" alt="Redis database dashboard" width="454" height="207" data-path="images/other-products/upstash/image6.png" />
</Frame>

## 3. Access connection details

Once the database is created, you'll see:

* The **REST API URL**
* The **REST Token**
* The **Redis Connection URL** — this is what you'll paste into your CAMB AI Website Configuration as the **Redis Cache URL (Secure)**.

<Frame caption="Figure 7 — Redis database connection details">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image7.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=9547887b28077d817b20bbd763353f28" alt="Redis database connection details panel" width="438" height="236" data-path="images/other-products/upstash/image7.png" />
</Frame>

<Warning>
  Make sure the Redis Connection URL you copy starts with `rediss://` (note the double `s`). This is the TLS-encrypted endpoint required by the Website Translator.
</Warning>

## 4. Clearing the Redis cache

If you need to clear all cached translations from your Redis database, use the Flush functionality.

* From the Upstash Console, open your Redis database.
* Navigate to the **CLI** tab.

<Frame caption="Figure 8 — CLI tab">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image8.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=c83c9b85feda3528f5a4db1c2b968381" alt="Upstash CLI tab" width="468" height="142" data-path="images/other-products/upstash/image8.png" />
</Frame>

* Execute the `FLUSHALL` or `FLUSHDB` command.

<Frame caption="Figure 9 — FLUSHDB command">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image9.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=cce3e7dd6ab3cf196b7ad0adef1cc09a" alt="Running FLUSHDB in the Upstash CLI" width="394" height="180" data-path="images/other-products/upstash/image9.png" />
</Frame>

## 5. Time-to-Live (TTL) and inactivity

Redis allows you to set a time-to-live (TTL) on keys. The TTL specifies how long a key remains in the cache before being automatically deleted.

Key points about TTL behavior:

* **Expiration** — When the TTL for a key reaches zero, Redis automatically deletes it.
* **No TTL set** — If you don't set a TTL, the key will persist until explicitly removed.
* **Inactivity** — Redis does not automatically expire keys due to inactivity unless a TTL has been defined.

## 6. Monitoring and management

In the Upstash dashboard, you can:

* Review memory usage and request metrics by going to the **Usage** tab.

<Frame caption="Figure 10 — Usage tab">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image10.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=247601a9e8b6acce00e627da48382633" alt="Usage tab showing memory and request metrics" width="420" height="192" data-path="images/other-products/upstash/image10.png" />
</Frame>

* Monitor keys and expiration patterns.
* Reset credentials or delete the database when no longer needed.

<Frame caption="Figure 11 — Credentials management">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image11.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=0fdc48d772c916e630080147462fb2eb" alt="Credentials management panel" width="378" height="172" data-path="images/other-products/upstash/image11.png" />
</Frame>

## 7. Connect Redis to your Website Configuration

With your Upstash database ready, integrate it into CAMB AI Studio:

1. Open the **Website Configuration** form in Studio.

<Frame caption="Figure 12 — Website Translation form on Studio">
  <img src="https://mintcdn.com/cambai/hO3-jvB7423Hixvi/images/other-products/upstash/image12.png?fit=max&auto=format&n=hO3-jvB7423Hixvi&q=85&s=9f688a52b2b74c51125b2c5f096c8018" alt="Website Translation configuration form" width="468" height="213" data-path="images/other-products/upstash/image12.png" />
</Frame>

2. Provide the following:
   * **Name** — A friendly name for your project (e.g., `My Website`).
   * **Domain** — Your production domain (e.g., `example.com`).
   * **Redis Cache URL (Secure)** — The secure `rediss://` connection string from your Upstash database.
   * **Translate From** — The source language for your website's content.
   * **Translate To** — One or more target languages.

3. Click **Create Website**. This generates an API key for your project, which your application can use to fetch and cache translations.

Next, see [Next.js (Page Router)](/other-products/website-translation/nextjs-page-router) to drop the script into your app.
