1 of 1 people found this helpful
L1 is a concept which applies to embedded distributed caches, where nodes keep local copies of data "owned" by other nodes so that multiple requests to that data will not incur an RPC. Obviously entries in L1 get invalidated when the data on the owner is changed.
It is enabled by setting the l1-lifespan attribute on the distributed-cache element to a value greater than 0:
<distributed-cache name="distributedCache" owners="2" l1-timeout="1000"/>
Refer to urn:infinispan:config:8.1 for a complete documentation of the configuration schema.
Programmatically, use the following:
Configuration c = new ConfigurationBuilder()
Near cache is similar, but applies to remote hotrod clients, and is explained in detail here: http://infinispan.org/docs/8.1.x/user_guide/user_guide.html#_near_caching
As for tutorials, we have quite an extensive tutorial available at Tutorials - Infinispan together with a bunch of examples highlighting many of our features.
If you need something specific, let us know
Can you please give me a simple programmatic example of nearcache for hotrod clients? if you have a some specific example please let me know? its really useful for us.
Near cache is just a configuration option, there's no extra API enabled by this option. All it does is enable clients to locally cache results from RemoteCache.get() calls internally, without affecting the end user code.
Can you please tell me what is difference between NearCacheMode.INVALIDATE and NearCacheMode.EAGER ? & what are the advantages & disadvantage of NearCacheMode.INVALIDATE ?
EAGER is deprecated so ignore it.