Information Technology Reference
In-Depth Information
5.4.2 Cache Placement
Caching can be local, in which case the software is performing its own caching, saving it-
self the trouble of requesting a lookup for each cache hit ( Figure 5.2a ) . Caching can be ex-
ternaltotheapplication,withacacheplacedbetweentheserverandtheexternalresources.
For example, a web cache sits between a web browser and the web server, intercepting re-
questsandcachingthemwhenpossible( Figure5.2b ).Cachescanalsobeattheserverside.
For example, a server that provides an API for looking up certain information might main-
tain its own cache that services requests when possible ( Figure 5.2c ) . If there are multiple
caches, some might potentially be outdated. The CAP Principle, described in Section 1.5 ,
then applies.
Figure 5.2: Cache placement
Not all caches are found in RAM. The cache medium simply must be faster than the
main medium. A disk can cache for data that has to be gathered from a remote server be-
cause disks are generally faster than remote retrieval. For example, YouTube videos are
cached in many servers around the world to conserve internet bandwidth. Very fast RAM
can cache for normal RAM. For example, the L1 cache of a CPU caches the computer's
mainmemory.Cachesarenotjustusedtoimprovedatalookups.Forexample, calculations
canbecached.Afunctionthatdoesadifficultmathematical calculationmightcacherecent
calculation results if they are likely to be requested again.
Search WWH ::




Custom Search