[id='adding-cache-configuration-templates_{context}']
= Adding cache templates

The {brandname} schema includes `*-cache-configuration` elements that you can use to create templates.
You can then create caches on demand, using the same configuration multiple times.

.Procedure

. Open your {brandname} configuration for editing.
. Add the cache configuration with the appropriate `*-cache-configuration` element or object to the cache manager.
. Save and close your {brandname} configuration.

[discrete]
== Cache template example

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

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

.YAML
[source,yaml,options="nowrap",subs=attributes+,role="secondary"]
----
include::yaml/distributed_cache_template.yaml[]
----
