This approach actually caches the DB-lookups and makes use of a lazy-load inspired way of loading all the data.
The old object-cache.inc.php fired a load of queries to the DB and defined a set of local variables with their results. Most of the queries made aren't always used, this slows down page load in some cases.
The proposed PR uses an instruction file located at includes/caches/<object-name>.inc.php to obtain a list of queries to perform.
The code stores values from the DB in the $GLOBALS array to cache them, This way the actual instance of the Object can be discarded and re-created but the cached data remains and wont result in a additional DB-Query.
The code also only Queries the DB if no shared cache exists and only Queries explicitly for the requested value instead of all at once.
This is a Drop-In-Replacement. The Class acts like an Array. It is possible to overlay local values, these are not traversed into the shared-cache and thus wont affect other code throughout the application.
Request for Comment :)
New global Object Cache