ezsystems/ezp-next — pull request #198 by andrerom (2013-01-09 12:24:57+00:00)
Title: Spi persistence cache

This PR is work in progress, it adds Persistence cache (aka "StorageEngine" cache) as a layer above the storage engine using a caching library called Stash which supports both APC, memcache(d) and others.

The benefit of doing this caching at this layer is that you don't have to care about permissions and can easily have one big pool of cache for all users, witch makes it much more memory efficient.

Currently only the main handler and Section handler has been implemented, as well as a factory to load the underlying (actual) storage engine on demand*.

CachedSectionHandler can potentially load all sections instead to be able to also cache loadAll() and loadByIdentifier() without duplicating cache. This can take advantage of Stash's support for hierarchal cache, so get( 'section' ) should return all sections.

The remaining parts to cache in prioritized order:
- Content Type (published)
- Location
- Content (published)
- Content Info (published)
- Version Info (published)
- Relations
- UserHandler::load*
- UserHandler::loadRoleAssignments*
- (other parts used by permission system)
- UrlALias
- UrlWildcard
- Object State
- Object State group
- Content Type Group
- Section\Handler::loadByIdentifier
- Section\Handler::loadAll
- (...)

\* This has the benefit of solving our database connection being openend when repository is loaded issue.