---
schema_version: "1"
id: 66d8bd7a7a678c090ea77ad1cf0457d3975a7db9d82846b6eed74fdac582d505
title: Configuring Omni Gateway Configuration Caching in Connected Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.13/conn-replica-caching.md
canonical_url: https://docs.mulesoft.com/gateway/1.13/conn-replica-caching
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 71e8c7582e8903845297dea26fd403ac583fae833750190c632c82cfd1cbf85c
description: MuleSoft Documentation Site
release: "1.13"
latest: false
---
---
product: Omni Gateway
version: 1.13
---

# Configuring Omni Gateway Configuration Caching in Connected Mode

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

To reduce scale-up time and increase resiliency, Omni Gateway can cache its gateway configuration in
shared storage. Omni replicas use the cached gateway configuration instead of each replica directly
downloading the configuration from Anypoint Platform. By default, configuration caching is not
enabled.

Omni Gateway configuration caching works by:

1.  After the first Omni replica starts, the replica downloads the configuration from Anypoint
    Platform, encrypts the configuration, and stores it in shared storage.

2.  After subsequent replicas start, they use the locally cached configuration rather than
    downloading from Anypoint Platform.

3.  If the Omni Gateway configuration changes on Anypoint Platform, the replicas download the
    configuration from Anypoint Platform and store it in shared storage for immediate use by the
    other replicas.

    Anytime a configuration is updated, the gateway reloads all local configuration resources.
    Reloading resources doesn’t create any network downtime and only changes the updated
    configuration. However, the gateway logs a runtime `info` message for each resource. To reduce
    logs, adjust your runtime log level.

If caching is configured and shared storage errors occur, each replica downloads configurations
directly from Anypoint Platform. If Omni Gateway disconnects from Anypoint Platform, Omni Gateway
uses the cached configuration until connections are restored.

> [!NOTE] When using distributed shared storage, cached configurations are lost when all replicas go
> down (Managed Gateway is stopped or self-managed is scaled to zero replicas). For persistent
> caching, use [Redis shared storage](https://docs.mulesoft.com/gateway/1.13/conn-shared-storage-config).

## Enable Omni Gateway Configuration Caching

1.  Make sure shared storage is configured.

    Configure either:

    - [Distributed shared storage](https://docs.mulesoft.com/gateway/1.13/conn-distributed-shared-storage-config): Cached configurations
      are lost when all replicas go down

    - [Redis shared storage](https://docs.mulesoft.com/gateway/1.13/conn-shared-storage-config): Cached configurations persist when all
      replicas go down

2.  Enable the `FLEX_DATASOURCE_CONTROL_NODE_ENABLED=true` environment variable.
