---
schema_version: "1"
id: a39249a0f87716c55da258779f6b5a2099c3c50e82d17ab80be2d7c39f4c9f8c
title: Configuring Flex 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.9/flex-conn-replica-caching.md
canonical_url: https://docs.mulesoft.com/gateway/1.9/flex-conn-replica-caching
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a8c0bcae3f2bcc3cdf275f2884e7b16cf7be46d1affb719729f519cd418f86d6
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
---
product: Omni Gateway
version: 1.9
---

# Configuring Flex Gateway Configuration Caching in Connected Mode

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

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

Flex Gateway configuration caching works by:

1.  After the first Flex replica starts, the replica downloads the configuration from Anypoint
    Platform, encrypts the configuration, and stores it in Redis.

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

3.  If the Flex Gateway configuration changes on Anypoint Platform, the replicas download the
    necessary configuration from Anypoint Platform and store it in Redis for immediate use by the
    other replicas.

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

## Enable Flex Gateway Configuration Caching

1.  Ensure the Redis shared storage is configured.

    To learn more, see
    [Configuring Shared Storage for Flex Gateway in Connected Mode](https://docs.mulesoft.com/gateway/1.9/flex-conn-shared-storage-config).

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