[id='cache_configuration']
= Cache Configuration
You can provide cache configuration in XML or JSON format.

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::config_examples/infinispan_distributed_cache.xml[]
----

.JSON
[source,json,options="nowrap",subs=attributes+,role="secondary"]
----
include::config_examples/infinispan_distributed_cache.json[]
----

[discrete]
== JSON format

Cache configuration in JSON format must follow the structure of an XML configuration.
* XML elements become JSON objects.
* XML attributes become JSON fields.
