[id='declarative-cache-configuration_{context}']
= Declarative cache configuration

You can configure caches declaratively, in XML, JSON, and YAML format, according to the {brandname} schema.

Declarative cache configuration has the following advantages over programmatic configuration:

Portability:: Define each configuration in a standalone file that you can use to create embedded and remote caches. +
You can also use declarative configuration to create caches with {ispn_operator} for clusters running on {k8s}.
Simplicity:: Keep markup languages separate to programming languages. +
For example, to create remote caches it is generally better to not add complex XML directly to Java code.

[NOTE]
====
{brandname} Server configuration extends `infinispan.xml` to include cluster transport mechanisms, security realms, and endpoint configuration.
If you declare caches as part of your {brandname} Server configuration you should use management tooling, such as Ansible or Chef, to keep it synchronized across the cluster.

To dynamically synchronize remote caches across {brandname} clusters, create them at runtime.
====

[TIP]
====
Wherever a time quantity, such as a timeout or an interval, is specified within a declarative configuration, it is possible
to describe it using time units:

* **ms**:  milliseconds
* **s**:  seconds
* **m**:  minutes
* **h**:  hours
* **d**:  days

Examples: `1000`,  `1s`,  `1.5h`, `10m`.
====