Community Documentation

Cache chain

Last updated January 10, 2013. Created by mitchell on January 10, 2013.
Log in to edit this page.

BackendChain defines a chained cache implementation for combining multiple cache backends.

A common use-case would be to chain a database cache backend (persistent) behind a memory cache backend (static). Now, when querying the BackendChain for a particular value it would first try to fetch that value from the memory cache backend up front. If the queried entry does not exist in the memory cache backend it would attempt to retrieve said value from the database cache backend and, if successful, propagate that value back to the memory cache backend. In case of a subsequent request the same value would now be fetched from the memory cache backend without having to query the database again. For more information, see #1651206: Added a cache chain implementation.