Skip to content
© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Cache and Redis Configuration

All parameters listed here correspond to settings in tb-edge.yml (or tb-edge.conf on Linux). Set them as environment variables in /etc/tb-edge/conf/tb-edge.conf (Linux) or as container environment variables (Docker / Kubernetes). For instructions on applying changes, see How to change configuration.

Parameter Env variable Default Description
cache.type CACHE_TYPE caffeine caffeine or redis(7.2 - latest compatible version)
cache.maximumPoolSize CACHE_MAXIMUM_POOL_SIZE 16 max pool size to process futures that call the external cache
cache.attributes.enabled CACHE_ATTRIBUTES_ENABLED true make sure that if cache.type is ‘redis’ and cache.attributes.enabled is ‘true’ if you change ‘maxmemory-policy’ Redis config property to ‘allkeys-lru’, ‘allkeys-lfu’ or ‘allkeys-random’
cache.ts_latest.enabled CACHE_TS_LATEST_ENABLED true Will enable cache-aside strategy for SQL timeseries latest DAO. make sure that if cache.type is ‘redis’ and cache.ts_latest.enabled is ‘true’ if you change ‘maxmemory-policy’ Redis config property to ‘allkeys-lru’, ‘allkeys-lfu’ or ‘allkeys-random’
cache.specs.relations.timeToLiveInMinutes CACHE_SPECS_RELATIONS_TTL 1440 Relations cache TTL
cache.specs.relations.maxSize CACHE_SPECS_RELATIONS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.deviceCredentials.timeToLiveInMinutes CACHE_SPECS_DEVICE_CREDENTIALS_TTL 1440 Device credentials cache TTL
cache.specs.deviceCredentials.maxSize CACHE_SPECS_DEVICE_CREDENTIALS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.devices.timeToLiveInMinutes CACHE_SPECS_DEVICES_TTL 1440 Device cache TTL
cache.specs.devices.maxSize CACHE_SPECS_DEVICES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.sessions.timeToLiveInMinutes CACHE_SPECS_SESSIONS_TTL 1440 Sessions cache TTL
cache.specs.sessions.maxSize CACHE_SPECS_SESSIONS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.assets.timeToLiveInMinutes CACHE_SPECS_ASSETS_TTL 1440 Asset cache TTL
cache.specs.assets.maxSize CACHE_SPECS_ASSETS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.customers.timeToLiveInMinutes CACHE_SPECS_CUSTOMERS_TTL 1440 Customer cache TTL
cache.specs.customers.maxSize CACHE_SPECS_CUSTOMERS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.users.timeToLiveInMinutes CACHE_SPECS_USERS_TTL 1440 User cache TTL
cache.specs.users.maxSize CACHE_SPECS_USERS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.entityViews.timeToLiveInMinutes CACHE_SPECS_ENTITY_VIEWS_TTL 1440 Entity view cache TTL
cache.specs.entityViews.maxSize CACHE_SPECS_ENTITY_VIEWS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.claimDevices.timeToLiveInMinutes CACHE_SPECS_CLAIM_DEVICES_TTL 1440 Claim devices cache TTL
cache.specs.claimDevices.maxSize CACHE_SPECS_CLAIM_DEVICES_MAX_SIZE 1000 0 means the cache is disabled
cache.specs.securitySettings.timeToLiveInMinutes CACHE_SPECS_SECURITY_SETTINGS_TTL 1440 Security settings cache TTL
cache.specs.securitySettings.maxSize CACHE_SPECS_SECURITY_SETTINGS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.tenantProfiles.timeToLiveInMinutes CACHE_SPECS_TENANT_PROFILES_TTL 1440 Tenant profiles cache TTL
cache.specs.tenantProfiles.maxSize CACHE_SPECS_TENANT_PROFILES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.tenants.timeToLiveInMinutes CACHE_SPECS_TENANTS_TTL 1440 Tenant cache TTL
cache.specs.tenants.maxSize CACHE_SPECS_TENANTS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.tenantsExist.timeToLiveInMinutes CACHE_SPECS_TENANTS_TTL 1440 Environment variables are intentionally the same as in ‘tenants’ cache to be equal.
cache.specs.tenantsExist.maxSize CACHE_SPECS_TENANTS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.deviceProfiles.timeToLiveInMinutes CACHE_SPECS_DEVICE_PROFILES_TTL 1440 Device profile cache TTL
cache.specs.deviceProfiles.maxSize CACHE_SPECS_DEVICE_PROFILES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.assetProfiles.timeToLiveInMinutes CACHE_SPECS_ASSET_PROFILES_TTL 1440 Asset profile cache TTL
cache.specs.assetProfiles.maxSize CACHE_SPECS_ASSET_PROFILES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.notificationSettings.timeToLiveInMinutes CACHE_SPECS_NOTIFICATION_SETTINGS_TTL 10 Notification settings cache TTL
cache.specs.notificationSettings.maxSize CACHE_SPECS_NOTIFICATION_SETTINGS_MAX_SIZE 1000 0 means the cache is disabled
cache.specs.sentNotifications.timeToLiveInMinutes CACHE_SPECS_SENT_NOTIFICATIONS_TTL 1440 Sent notifications cache TTL
cache.specs.sentNotifications.maxSize CACHE_SPECS_SENT_NOTIFICATIONS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.attributes.timeToLiveInMinutes CACHE_SPECS_ATTRIBUTES_TTL 1440 Attributes cache TTL
cache.specs.attributes.maxSize CACHE_SPECS_ATTRIBUTES_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.tsLatest.timeToLiveInMinutes CACHE_SPECS_TS_LATEST_TTL 1440 Timeseries latest cache TTL
cache.specs.tsLatest.maxSize CACHE_SPECS_TS_LATEST_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.userSessionsInvalidation.timeToLiveInMinutes _(none)_ "0" The value of this TTL is ignored and replaced by the JWT refresh token expiration time
cache.specs.userSessionsInvalidation.maxSize CACHE_SPECS_USERS_UPDATE_TIME_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.otaPackages.timeToLiveInMinutes CACHE_SPECS_OTA_PACKAGES_TTL 60 Ota packages cache TTL
cache.specs.otaPackages.maxSize CACHE_SPECS_OTA_PACKAGES_MAX_SIZE 10 0 means the cache is disabled
cache.specs.otaPackagesData.timeToLiveInMinutes CACHE_SPECS_OTA_PACKAGES_DATA_TTL 60 Ota packages data cache TTL
cache.specs.otaPackagesData.maxSize CACHE_SPECS_OTA_PACKAGES_DATA_MAX_SIZE 10 0 means the cache is disabled
cache.specs.edges.timeToLiveInMinutes CACHE_SPECS_EDGES_TTL 1440 Edges cache TTL
cache.specs.edges.maxSize CACHE_SPECS_EDGES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.edgeSessions.timeToLiveInMinutes CACHE_SPECS_EDGE_SESSIONS_TTL 0 Edge Sessions cache TTL; no expiration time if set to ‘0’
cache.specs.edgeSessions.maxSize CACHE_SPECS_EDGE_SESSIONS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.relatedEdges.timeToLiveInMinutes CACHE_SPECS_RELATED_EDGES_TTL 1440 Related Edges cache TTL
cache.specs.relatedEdges.maxSize CACHE_SPECS_RELATED_EDGES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.repositorySettings.timeToLiveInMinutes CACHE_SPECS_REPOSITORY_SETTINGS_TTL 1440 Repository settings cache TTL
cache.specs.repositorySettings.maxSize CACHE_SPECS_REPOSITORY_SETTINGS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.autoCommitSettings.timeToLiveInMinutes CACHE_SPECS_AUTO_COMMIT_SETTINGS_TTL 1440 Autocommit settings cache TTL
cache.specs.autoCommitSettings.maxSize CACHE_SPECS_AUTO_COMMIT_SETTINGS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.twoFaVerificationCodes.timeToLiveInMinutes CACHE_SPECS_TWO_FA_VERIFICATION_CODES_TTL 60 Two factor verification codes cache TTL
cache.specs.twoFaVerificationCodes.maxSize CACHE_SPECS_TWO_FA_VERIFICATION_CODES_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.versionControlTask.timeToLiveInMinutes CACHE_SPECS_VERSION_CONTROL_TASK_TTL 20 Version control task cache TTL
cache.specs.versionControlTask.maxSize CACHE_SPECS_VERSION_CONTROL_TASK_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.userSettings.timeToLiveInMinutes CACHE_SPECS_USER_SETTINGS_TTL 1440 User settings cache TTL
cache.specs.userSettings.maxSize CACHE_SPECS_USER_SETTINGS_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.dashboardTitles.timeToLiveInMinutes CACHE_SPECS_DASHBOARD_TITLES_TTL 1440 Dashboard titles cache TTL
cache.specs.dashboardTitles.maxSize CACHE_SPECS_DASHBOARD_TITLES_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.entityCount.timeToLiveInMinutes CACHE_SPECS_ENTITY_COUNT_TTL 1440 Entity count cache TTL
cache.specs.entityCount.maxSize CACHE_SPECS_ENTITY_COUNT_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.resourceInfo.timeToLiveInMinutes CACHE_SPECS_RESOURCE_INFO_TTL 1440 Resource info cache TTL
cache.specs.resourceInfo.maxSize CACHE_SPECS_RESOURCE_INFO_MAX_SIZE 100000 0 means the cache is disabled
cache.specs.alarmTypes.timeToLiveInMinutes CACHE_SPECS_ALARM_TYPES_TTL 60 Alarm types cache TTL
cache.specs.alarmTypes.maxSize CACHE_SPECS_ALARM_TYPES_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.mobileAppSettings.timeToLiveInMinutes CACHE_SPECS_MOBILE_APP_SETTINGS_TTL 1440 Mobile application cache TTL
cache.specs.mobileAppSettings.maxSize CACHE_SPECS_MOBILE_APP_SETTINGS_MAX_SIZE 10000 0 means the cache is disabled
cache.specs.mobileSecretKey.timeToLiveInMinutes CACHE_MOBILE_SECRET_KEY_TTL 2 QR secret key cache TTL
cache.specs.mobileSecretKey.maxSize CACHE_MOBILE_SECRET_KEY_MAX_SIZE 10000 0 means the cache is disabled
cache.notificationRules.timeToLiveInMinutes CACHE_SPECS_NOTIFICATION_RULES_TTL 30 Notification rules cache TTL
cache.notificationRules.maxSize CACHE_SPECS_NOTIFICATION_RULES_MAX_SIZE 1000 0 means the cache is disabled
cache.rateLimits.timeToLiveInMinutes CACHE_SPECS_RATE_LIMITS_TTL 120 Rate limits cache TTL
cache.rateLimits.maxSize CACHE_SPECS_RATE_LIMITS_MAX_SIZE 200000 0 means the cache is disabled
cache.entityLimits.timeToLiveInMinutes CACHE_SPECS_ENTITY_LIMITS_TTL 5 Entity limits cache TTL
cache.entityLimits.maxSize CACHE_SPECS_ENTITY_LIMITS_MAX_SIZE 100000 0 means the cache is disabled
cache.image.etag.timeToLiveInMinutes CACHE_SPECS_IMAGE_ETAGS_TTL 44640 Image ETags cache TTL
cache.image.etag.maxSize CACHE_SPECS_IMAGE_ETAGS_MAX_SIZE 10000 0 means the cache is disabled
cache.image.systemImagesBrowserTtlInMinutes CACHE_SPECS_IMAGE_SYSTEM_BROWSER_TTL 0 Browser cache TTL for system images in minutes. 0 means the cache is disabled
cache.image.tenantImagesBrowserTtlInMinutes CACHE_SPECS_IMAGE_TENANT_BROWSER_TTL 0 Browser cache TTL for tenant images in minutes. 0 means the cache is disabled
Parameter Env variable Default Description
spring.data.redis.repositories.enabled _(none)_ false Disable this because it is not required.
Parameter Env variable Default Description
redis.connection.type REDIS_CONNECTION_TYPE standalone Redis deployment type: Standalone (single Redis node deployment) OR Cluster
redis.standalone.host REDIS_HOST localhost Redis connection host
redis.standalone.port REDIS_PORT 6379 Redis connection port
redis.standalone.useDefaultClientConfig REDIS_USE_DEFAULT_CLIENT_CONFIG true Use the default Redis configuration file
redis.standalone.clientName REDIS_CLIENT_NAME standalone This value may be used only if you used not default ClientConfig
redis.standalone.connectTimeout REDIS_CLIENT_CONNECT_TIMEOUT 30000 This value may be used only if you used not default ClientConfig
redis.standalone.readTimeout REDIS_CLIENT_READ_TIMEOUT 60000 This value may be used only if you used not default ClientConfig
redis.standalone.usePoolConfig REDIS_CLIENT_USE_POOL_CONFIG false This value may be used only if you used not default ClientConfig
redis.cluster.nodes REDIS_NODES _(empty)_ Comma-separated list of “host:port” pairs to bootstrap from.
redis.cluster.max-redirects REDIS_MAX_REDIRECTS 12 Maximum number of redirects to follow when executing commands across the cluster.
redis.cluster.useDefaultPoolConfig REDIS_USE_DEFAULT_POOL_CONFIG true if set false will be used pool config build from values of the pool config section
redis.sentinel.master REDIS_MASTER _(empty)_ name of the master node
redis.sentinel.sentinels REDIS_SENTINELS _(empty)_ comma-separated list of “host:port” pairs of sentinels
redis.sentinel.password REDIS_SENTINEL_PASSWORD _(empty)_ password to authenticate with sentinel
redis.sentinel.useDefaultPoolConfig REDIS_USE_DEFAULT_POOL_CONFIG true if set false will be used pool config build from values of the pool config section
redis.db REDIS_DB 0 db index
redis.password REDIS_PASSWORD _(empty)_ db password
redis.ssl.enabled TB_REDIS_SSL_ENABLED false Enable/disable secure connection
redis.ssl.credentials.cert_file TB_REDIS_SSL_PEM_CERT _(empty)_ Path redis server (CA) certificate
redis.ssl.credentials.user_cert_file TB_REDIS_SSL_PEM_KEY _(empty)_ Path to user certificate file. This is optional for the client and can be used for two-way authentication for the client
redis.ssl.credentials.user_key_file TB_REDIS_SSL_PEM_KEY_PASSWORD _(empty)_ Path to user private key file. This is optional for the client and only needed if ‘user_cert_file’ is configured.
redis.pool_config.maxTotal REDIS_POOL_CONFIG_MAX_TOTAL 128 Maximum number of connections that can be allocated by the connection pool
redis.pool_config.maxIdle REDIS_POOL_CONFIG_MAX_IDLE 128 Maximum number of idle connections that can be maintained in the pool without being closed
redis.pool_config.minIdle REDIS_POOL_CONFIG_MIN_IDLE 16 Minumum number of idle connections that can be maintained in the pool without being closed
redis.pool_config.testOnBorrow REDIS_POOL_CONFIG_TEST_ON_BORROW true Enable/Disable PING command sent when a connection is borrowed
redis.pool_config.testOnReturn REDIS_POOL_CONFIG_TEST_ON_RETURN true The property is used to specify whether to test the connection before returning it to the connection pool.
redis.pool_config.testWhileIdle REDIS_POOL_CONFIG_TEST_WHILE_IDLE true The property is used in the context of connection pooling in Redis
redis.pool_config.minEvictableMs REDIS_POOL_CONFIG_MIN_EVICTABLE_MS 60000 Minimum time that an idle connection should be idle before it can be evicted from the connection pool. The value is set in milliseconds
redis.pool_config.evictionRunsMs REDIS_POOL_CONFIG_EVICTION_RUNS_MS 30000 Specifies the time interval in milliseconds between two consecutive eviction runs
redis.pool_config.maxWaitMills REDIS_POOL_CONFIG_MAX_WAIT_MS 60000 Maximum time in milliseconds where a client is willing to wait for a connection from the pool when all connections are exhausted
redis.pool_config.numberTestsPerEvictionRun REDIS_POOL_CONFIG_NUMBER_TESTS_PER_EVICTION_RUN 3 Specifies the number of connections to test for eviction during each eviction run
redis.pool_config.blockWhenExhausted REDIS_POOL_CONFIG_BLOCK_WHEN_EXHAUSTED true Determines the behavior when a thread requests a connection from the pool, but there are no available connections, and the pool cannot create more due to the maxTotal configuration
redis.evictTtlInMs REDIS_EVICT_TTL_MS 60000 TTL for short-living SET commands that are used to replace DEL to enable transaction support