Skip to main content

Configure the POM cache

Moderne Platform services do not talk to your Maven repositories directly. When a service needs a file from a repository that is only reachable inside your network, the request is tunneled through the Moderne Connector, which adds the credentials you configured and makes the call on the service's behalf. Two things drive most of that traffic:

  • Recipe loading. Before a recipe can be installed, the Platform walks the recipe artifact's POM dependency graph against your recipe marketplace repositories to assemble its classpath.
  • Recipe execution. Recipes that upgrade dependencies read maven-metadata.xml to determine which versions your repositories actually serve, so a run over many repositories requests the same metadata many times.

Both paths fetch the same small set of files repeatedly, so the Connector can cache them and serve repeat lookups locally instead of calling your artifact repository again. Only .pom files and maven-metadata.xml are cached — JARs and other artifacts always stream straight through.

Caching is disabled by default. Set the cache type to IN_MEMORY to cache within a single Connector instance, or to REDIS to share one cache across multiple Connector replicas. If the Connector cannot initialize the Redis connection, it logs the failure and runs without a cache.

Environment variables:

Variable NameRequiredDefaultDescription
MODERNE_CONNECTOR_RECIPE_POMCACHE_TYPEfalseUsed to specify what type of cache the POM should use. Acceptable values: IN_MEMORY or REDIS. If unset, no caching is performed.
MODERNE_CONNECTOR_RECIPE_POMCACHE_POMTTLfalse60mHow long cached .pom files should live in the POM cache. Specified as a duration (e.g., 60m, 2h).
MODERNE_CONNECTOR_RECIPE_POMCACHE_METADATATTLfalse10mHow long cached maven-metadata.xml files should live in the POM cache. This defaults lower than pomTtl because metadata changes as new versions are published.
MODERNE_CONNECTOR_RECIPE_POMCACHE_ENTRYTTLMINUTESfalseDeprecated – use MODERNE_CONNECTOR_RECIPE_POMCACHE_POMTTL instead. If set, this value in minutes is used as the .pom TTL.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_HOSTtrue (If the POM cache type is REDIS)The URL of the Redis instance.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_PORTtrue (If the POM cache type is REDIS)6379The port number of the Redis instance.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_USERNAMEfalseThe username needed to authenticate to the Redis instance.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_PASSWORDfalseThe password needed to authenticate with the Redis instance.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_SSLfalsefalseIf set to true, then SSL will be enabled for the connection to the Redis instance.
MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_DATABASEfalse0The Redis DB index.

Example:

docker run \
# ... Existing variables
-e MODERNE_CONNECTOR_RECIPE_POMCACHE_TYPE=REDIS \
-e MODERNE_CONNECTOR_RECIPE_POMCACHE_REDIS_HOST=localhost \
# ... Additional variables