Typically a bottleneck in performance occur while retrieving and writing application data that resides in database and application data in session states. We can use the various levels of caching in SharePoint 2010 to increase the performance of SharePoint applications as written in the previous article. In-memory distributed caching is a form of caching that allows the cache to span multiple servers so that it can grow in size and in transactional capacity.
In SharePoint 2013 there is a new service called Distributed Cache. The Distributed Cache service is built on Windows Server AppFabric, which implements the AppFabric Caching service. Windows Server AppFabric installs with the prerequisites for SharePoint Server 2013. 
The Distributed Cache service provides in-memory caching services and does not have a dependency on databases for several features in SharePoint Server 2013. Some of the features that use the Distributed Cache service include:
- Newsfeeds
- Authentication
- OneNote client access
- Security Trimming
- Page load performance
When the service is enabled, these features use the Distributed Cache for quick data retrieval. Blob Cache and Output Cache do not use a distributed caching service since these types of cache exist on each Web Front End server in the farm.
Cache Cluster
Any server in the farm running the Distributed Cache service is known as a cache host. A cache cluster is the group of all cache hosts in a SharePoint Server 2013 farm. A cache host joins a cache cluster when a new application server running the Distributed Cache service is added to the farm. When using a cache cluster, the Distributed Cache spans all application servers and creates one cache in the server farm. The total cache size is the sum of the memory allocated to the Distributed Cache service on each of the cache hosts.
The Distributed Cache service can run in dedicated or collocated mode. When running in dedicated mode, the Distributed Cache service is started and all other services are stopped on the server. In collocated mode, the Distributed Cache service is running along with other services on the server.
Various caches that depend on the Distributed Cache service
The Following are the SPDistributedCacheContainerType enumerations to set or clear the distributed cache settings. The core API has namespace Microsoft.SharePoint.DistributedCaching.Utilities.
Example

Veena SardaPosted Dec 4, 2012, 10:56 PM
All data in the cache cluster is stored in memory on the cache servers. By default the data is stored in the memory on only one server in the cache cluster. By enabling the high-availability option in the AppFabric Caching Services a second copy of each cached item is created on another server in the cache cluster. The first cached item is called the primary item and the second copy is the secondary item. In case a server in the cache cluster becomes unavailable the data is available on one of the other servers. The secondary item is then promoted to the primary item and a new secondary item is created on another server in the cluster.
Venkatesh KumarPosted Dec 3, 2012, 1:07 PM
Very good Summary. but not sure, how we can handle improper cache(server) shutdown...