[id='configuring-near-caching-{context}']
= Configuring Near Caches
Configure Hot Rod Java clients with near caches to store recently used data locally in the client JVM.

.Procedure

. Open your Hot Rod Java client configuration.
. Configure each cache to perform near caching with the `nearCacheMode(NearCacheMode.INVALIDATED)` method.
+
[NOTE]
====
{brandname} provides global near cache configuration properties.
However, those properties are deprecated and you should not use them but configure near caching on a per-cache basis instead.
====
+
. Specify the maximum number of entries that the near cache can hold before eviction occurs with the `nearCacheMaxEntries()` method.
. Enable bloom filters for near caches with the `nearCacheUseBloomFilter()` method.

[source,java]
----
include::code_examples/HotRodNearCaching.java[]
----

[role="_additional-resources"]
.Additional resources

* link:{javadocroot}/org/infinispan/client/hotrod/configuration/NearCacheConfiguration.html[org.infinispan.client.hotrod.configuration.NearCacheConfiguration]
* link:{javadocroot}/org/infinispan/client/hotrod/configuration/ExhaustedAction.html[org.infinispan.client.hotrod.configuration.ExhaustedAction]
