@@ -4,6 +4,32 @@ Caching is a key component of any significant Web or REST backend so as to avoid
4
4
performance issues when accessing the storage tier, in term of latency,
5
5
throughput and resource usage.
6
6
7
+ ## Cache Hierarchy
8
+
9
+ In a modern web or mobile application, caching may take place at multiple
10
+ levels to hide the fundamental sluggishness of network and database/disk
11
+ accesses to permanent, reliable and transactional storage, mostly due to
12
+ latency:
13
+
14
+ - at the web application level, ` SWR ` and ` redux ` are libraries designed
15
+ to hide the latency of accessing remote datai, et by providing _ stale_
16
+ data while waiting for updates or keeping a local state.
17
+ - at the web browser level, honoring HTTP ` Cache-Control ` headers helps
18
+ the application avoiding actual HTTP request.
19
+ - at the HTTP server/proxy level, response may be cached with specific
20
+ modules, such as ` mod_cache ` for Apache.
21
+ - at the server application level, say a Python Flask back-end in Python,
22
+ CacheTools and CacheToolsUtils can help maintain efficient data accesses,
23
+ possibly using multilevel in-memory distributed caches such as Redis or
24
+ Memcached.
25
+ - at the application architectural level, services such as elasticache
26
+ can hide data accesses and indexing, in effect replicating the entire
27
+ underlying database.
28
+ - within the database itself, accesses to raw data are cached in shared
29
+ memory, both at the OS and database level.
30
+ - at the the hardware level, storage can benefit from différent
31
+ levels of caches.
32
+
7
33
## Shared Cache
8
34
9
35
A convenient setup is to have * one* shared cache storage tier at the
0 commit comments