When requests for those web-pages are generated by the user, the browser can simply retrieve the downloaded pages which will be much faster than loading other web-pages which are not cached. For example, a browser may download web-pages that are most-frequently used by the user. In the event of a cache miss, the data will need to be computed or located from a slower data source, which will take much longer time to generate, than a cache hit. On the other hand, a cache miss occurs when the requested data is not stored in the cache. When the data requested from a cache is successfully found, it is called a cache hit. Otherwise, it will generate that data, which will be stored in the cache for a future request. If yes, it will simply retrieve that data and access it. When an application needs to access some data (which is expected to be cached), it will first check if that data exists in its cache. What is cache?Ĭache refers to the storage of data that is likely to be requested in the future. Also, inspired by this Clojure repository on Github, I attempt to implement some of the common cache replacement policies. In this post, I attempt to discuss what the term ‘cache’ actually means and delve into some of the common cache replacement policies. It is said that “There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.” This post will be on the first one.
0 Comments
Leave a Reply. |