\CacheableCacheInspectorController
Allows qualified (Admin) users a view into the state of the object cache.
Very useful for diagnosing problems when suspecting object(s) haven't been cached,
or you're experiencing other cache-related problems.
At time of writing, only detailed information on the "file" baxckend is available.
With any other backend, all you'll see is the Cache / DB comparison.
- Author: Deviate Ltd 2015 http://www.deviate.net.nz
Synopsis
class CacheableCacheInspectorController
extends Controller
{
- // members
- private static array $allowed_actions = ;
- protected DataList $_dbObjects = ;
- protected array $_cachedIDs = ;
- protected array $_dbObjectIDs = ;
- // methods
- public void init()
- public HTMLText handleAction()
- public HTMLText inspect()
- private int getTotalCachedObjects()
- private int getTotalDBObjects()
- private ArrayData cacheToORMCompareDataObject()
- private string getCacheLastUpdated()
- private int getCacheSize()
- private string printStatus()
Hierarchy
Extends
- Controller
Tasks
Line | Task |
---|---|
15+ | Add status for non-file backends |
Members
private
- $allowed_actions — array
protected
- $_cachedIDs — array
- $_dbObjectIDs — array
- $_dbObjects — DataList
Methods
private
- cacheToORMCompareDataObject() — Generate output that indicates the health of the cache.
- getCacheLastUpdated() — Get the last update time of the cache.
- getCacheSize() — Get the size of the object-cache in bytes.
- getTotalCachedObjects() — Get the total no. objects in the cache. Due to the way {@link CacheableNavigation} works, this is restricted to "SiteTree-ish" objects only at this point.
- getTotalDBObjects() — Get the total no. objects in the DB. Due to the way {@link CacheableNavigation} works, this is restricted to "SiteTree-ish" objects only at this point.
- printStatus() — Used with {@link $this->cacheToORMCompareDataObject} to highlight OK/FAILed items in the UI.
public
- handleAction()
- init()
- inspect() — Generate key information about the object cache.