Custom HCL Cache configuration

Settings in the custom configuration file, which shares the same format as the default configuration file, override settings in the default configuration file.

Caches are configured using two files. The cache_cfg.yaml configuration file contains default configurations, and specific values for default caches. The custom cache_cfg-ext.yaml file can be used to update defaults or set new configurations for custom caches. The cache_cfg-ext.yaml file is contained in the configuration maps in Kubernetes.

For more information about the caching defaults stored in Kubernetes, see the sample file stored in the HCL Commerce Github repository.

Important: The custom cache configuration file (cache_cfg-ext.yaml) is merged with the default configuration file and allows the overriding of default configurations. If you are customizing an existing cache, include the complete cache definition in the custom configuration file.

Modify or extend the function of the HCL Cache by making changes to this file. Required or other default settings which are not present in this file will fall back to their values that are found in the default configuration file.

  • Cache_cfg-ext.yaml file changes:
    # cache_cfg-ext.yaml content read from values
    enabled: true
    yamlConfig: "/SETUP/hcl-cache/redis_cfg.yaml" # Please leave this line untouched
          enabled: true
  • configMaps values:
    apiVersion: v1
    # content for cache_cfg-ext.yaml
        cache_cfg_ext: |-
            enabled: true
            yamlConfig: "/SETUP/hcl-cache/redis_cfg.yaml" # Please leave this line untouched
          # Cache configurations
            # Default configuration enables local and remote caching
            # See defaultCacheConfig in /SETUP/hcl-cache/cache_cfg.yaml for the out-of-the-box 
            # default configuration.
            # The following custom configurations extend and override the definitions in the
            # /SETUP/hcl-cache/cache_cfg.yaml file.
                enabled: false
                enabled: false
        # content for redis_cfg.yaml
        redis_cfg: |-
            idleConnectionTimeout: 10000
            connectTimeout: 3000
            timeout: 1000
            retryAttempts: 3
            retryInterval: 500
            subscriptionsPerConnection: 5
            sslEnableEndpointIdentification: true
            sslProvider: "JDK"
            pingConnectionInterval: 30000
            keepAlive: true
            tcpNoDelay: true
            address: "redis://hcl-commerce-redis-master.redis.svc.cluster.local.:6379"
            subscriptionConnectionMinimumIdleSize: 1
            subscriptionConnectionPoolSize: 50
            connectionMinimumIdleSize: 24
            connectionPoolSize: 64
            database: 0
            dnsMonitoringInterval: 5000
            password: "${JNDI/ENCRYPTED:REDIS_PASSWORD_ENCRYPT:-}"
          threads: 16
          nettyThreads: 32
          referenceEnabled: true
          transportMode: "NIO"
          lockWatchdogTimeout: 30000
          keepPubSubOrder: true
          useScriptCache: false
          minCleanUpDelay: 5
          maxCleanUpDelay: 1800
          addressResolverGroupFactory: !<org.redisson.connection.DnsAddressResolverGroupFactory> {}
Review the default HCL Cache configuration file reference to make your customizations.
Note: Share, Live and Auth are the three configuration maps; always synchronize changes between these maps.