When ๐๐ฐ๐ฎ๐น๐ถ๐ป๐ด ๐ฎ๐ฝ๐ฝ๐น๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป๐ the database is often one of the bottlenecks. Caching is an effective way of reducing load on the database engine and increase response speed of the application.
The diagrams above describe the four most common caching patterns: cache-aside, read-through, write-through and write-behind. Which one to chose depends on your application.