---
schema_version: "1"
id: 48bf363b71ef05c19f785365e7b21e05296717be94beed7b26b592bd4209fc9d
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/latest/conn-replica-caching.md
canonical_url: https://docs.mulesoft.com/gateway/latest/conn-replica-caching
source_site: docs.mulesoft.com
content_type: documentation
content_hash: aa52f2dde897fcaf34111d01b61c73437f2bf44d454e16a85734f386d551fdbd
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
---

# 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 caches its gateway configuration
instead of each replica directly downloading the configuration from Anypoint Platform.

Configuration caching is enabled by default. To share cached configurations across replicas, you
must configure distributed or Redis shared storage.

If Omni Gateway disconnects from Anypoint Platform, replicas use the cached configuration until
connections are restored.

> [!NOTE] 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.

## Distributed Configuration Caching

When you configure distributed or Redis shared storage, replicas share a single cached configuration
instead of each replica caching its own copy. This reduces load on Anypoint Platform and speeds up
replica startup.

Distributed 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 cached configuration rather than downloading from
    Anypoint Platform.

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

If caching is configured and shared storage errors occur, each replica downloads configurations
directly from Anypoint Platform.

## Local Filesystem Caching

When no shared storage is configured, Omni Gateway uses the local filesystem storage. Because local
filesystem storage isn’t shared between replicas, each replica caches its own configuration rather
than sharing a cache with other replicas:

1.  When a replica starts, it downloads the configuration from Anypoint Platform, encrypts it, and
    stores it in its local filesystem.

2.  If the replica restarts, it reads the cached configuration from its local filesystem instead of
    downloading it from Anypoint Platform again.

3.  If the Omni Gateway configuration changes on Anypoint Platform, the replica downloads the
    updated configuration and stores it to the local filesystem.

## Enable Omni Gateway Configuration Caching

Configuration caching is enabled by default via the `FLEX_DATASOURCE_CONTROL_NODE_ENABLED`
environment variable, which is set to `true`.

By default, each replica caches its configuration to local filesystem storage. To share cached
configurations across replicas, configure a shared storage resource:

- [Distributed shared storage](https://docs.mulesoft.com/gateway/latest/conn-distributed-shared-storage-config)

- [Redis shared storage](https://docs.mulesoft.com/gateway/latest/conn-shared-storage-config)

## Disable Omni Gateway Configuration Caching

To disable configuration caching, set the `FLEX_DATASOURCE_CONTROL_NODE_ENABLED` environment
variable to `false`.
