Monday, June 24, 2013

What is a Cache?

A Cache refers to an intermediate storage location which can respond quickly to requests, thereby helping in improving the performance of the applications which makes use of the Cache.

In Hardware we refer to Cache memory as an intermediate memory which stores frequently used data and responds quickly when the processor requests the data. For example RAM (Random Access memory) is a intermediate cache memory used to store and respond to frequently used data. Data stored in the cache memory is retrieved quickly as compared to the data stored in the hard disk. Similarly a cache in the software world in an intermediate storage location used to provide quick response to users requests. 

For example static data like ‘list of countries’ used to populate a country dropdown can be stored in a Cache and returned to the UI to populate the dropdown. The data stored in the cache will be returned quickly when compared to the data stored in a database table; hence the UI can populate the dropdown quickly.

In the above example, we use the cache to store the ‘list of countries’, this data is almost like a constant, and hardly changes, hence this is an ideal candidate to be stored in a Cache, similarly which designing an application we will have to look into appropriate data which can be stored in the cache to improve performance.

Search Flipkart Products:

No comments: