# Caching

There are two types of caching available, ***InMemory*** & ***Redis***.

* In memory caching is used by default
* Redis should be used instead in production environments where multiple instances of the same application might exist.

### Configuration

Configure the **CacheProvider** *appsettings.json* property as follow:

* **In Memory Caching**: *InMemory* or  empty string or non existing property:
* **Redis Caching**: Redis

**Examples**

```
"CacheProvider": "InMemory"
```

```
"CacheProvider": "Redis",
"RedisConnectionString": "127.0.0.1:6379"
```

#### Notes

* With Redis caching, you also need to configure the **RedisConnectionString** property
* Configure the caching for <mark style="color:blue;">Harmony.Api</mark> & <mark style="color:blue;">Harmony.Automations</mark> projects


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chsakell.gitbook.io/harmony/configuration/dependencies/caching.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
