[id='cli-configuring-media-types_{context}']
= Configuring Media Types
Encode cache entries with different media types to store data in a format that best suits your requirements.

For example, the following procedure shows you how to configure the `application/x-protostream` media type.

.Procedure

. Create a {brandname} configuration file that adds a distributed cache named `qcache` and configures the media type, for example:
+
[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/indexing_person_cache.xml[]
----
+
. Create `pcache` from `pcache.xml` with the [command]`--file=` option.
+
[source,options="nowrap",subs=attributes+]
----
[//containers/default]> create cache --file=pcache.xml pcache
----
+
. Verify `pcache`.
+
[source,options="nowrap",subs=attributes+]
----
[//containers/default]> ls caches
pcache
___protobuf_metadata
[//containers/default]> describe caches/pcache
{
  "distributed-cache" : {
    "mode" : "SYNC",
    "encoding" : {
      "key" : {
        "media-type" : "application/x-protostream"
      },
      "value" : {
        "media-type" : "application/x-protostream"
      }
    },
    "transaction" : {
      "mode" : "NONE"
    }
  }
}
----
. Add an entry to `pcache` and check the encoding.
+
[source,options="nowrap",subs=attributes+]
----
[//containers/default]> put --cache=pcache good morning
[//containers/default]> cd caches/pcache
[//containers/default/caches/pcache]> get good
{
  "_type" : "string",
  "_value" : "morning"
}
----
