---
schema_version: "1"
id: 5d7ab7a0c58a0b6b5ed107903019e0806e8c73e3c34be495b7db109c2f669d6f
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.12/flex-conn-replica-caching.md
canonical_url: https://docs.mulesoft.com/gateway/1.12/flex-conn-replica-caching
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a996db9612df409117943409af13b5af58398bba711508f54b3ac3521b1f34b1
description: MuleSoft Documentation Site
release: "1.12"
latest: false
---
---
product: Omni Gateway
version: 1.12
---

# 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.12/flex-conn-shared-storage-config).

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