I can understand that the Prefetch cache is very useful for caching items in the database - thereby reducing reads to the SQL server. I can also understand the HTML cache is useful for caching the end result of a rendered component - thereby greatly improving performance. I would like to know what kind of benefit the Item and Data caches give? They seem very similar to me and I'm wondering if they are both needed - or are they just consuming memory for little gain?
Data Cache - Data caches store data from all the data providers defined for the database. The cache contains items of the Sitecore class “ItemInformation”, pulled from the database whenever they are requested.
The data is pulled from the Prefetch cache, if it presents there; else it is pulled out of the database, put into the Prefetch cache and into then the data cache.
The purpose of this cache is to minimise the number of requests to the database. This is extremely important for performance, as requesting items from the database is rather expensive. The maximum size of the Data cache can be configured.
Item Cache - Item caches contain objects of the Sitecore class “Sitecore.Data.Items.Item” that are used in the code most of the time.
The items are built from the “ItemInformation” objects in the data cache, hence, are dependent on database data caches. So, if we request an item, which isn’t present in the item cache, it will get it from the data cache and then populate it in the item cache as an Item.
The reason for this cache is to gain performance so the ItemInformation objects don’t need to get parsed into an Item each time they are requested.
Hope above information will help.
The ItemCache caches the Item itself, with all of the fields and associated information. It allows for faster retrieval when you call GetItem or when Items are resolved in pipelines such as HttpRequest so that there aren't constant database queries.
The DataCache caches Information about the an item, such as the item's Child ID's, the languages and versions, the parent, and information surrounding the template.