Knowledgebase: User Manual
Customizing the High Level Caching System
Posted by AJ Hall, Last modified by Mark [Elevated X Support] on 01 May 2014 04:52 PM

Customizing the High Level Caching System

High Level Caching is a system is present within the CMS to reduce database usage and speed up general page loads.

The high level caching system is extendable, so a developer can add to the conditions that determine whether or not a page is cached.

Here's how high level caching works:
(Replace with the URL to your members area).

Any front facing page covered by the CMS can have the argument highlevelcachedebug=1 added to it.  If high level cache is enabled, you'll see a debug page listing cache dependencies.

Here, you'll see two categories of dependencies - temporary and permanent.

Temporary dependencies are things that may change, such as when the database was last updated, when the template was last updated, stuff like that.
Permanent dependencies are things that don't change, such as what page you're on (index,gallery), what id it's trying to access (1,2,3), what page you're on (1,2,3), or what type you're trying to access (highres, vids).

Both the temporary dependencies and the permanent dependencies are separately serialized, and hashed into an md5sum. The permanent md5sum determines the directory structure within /cms_admin/storage/cache/, and the temporary dependency determines the name of the file within the cache store:


The file that's stored is the HTML output of the page. By having high level caching turned on, it's saving hits to the database, and the template transform process.

Adding to the cache dependency:
1) You'll need to add the following to cmsinclude.ini.php in your members area:

Use this guide for help:

Within a separate PHP include, you'll need to define:

function myCacheFunc(&$deps)
// example piece of code.
$deps["perm"]["xxx"] = $_GET["xxx"];

There, you'll need to add dependencies to the cache engine as you see fit. This way, the system will take into account any variables you take into account.

(3 vote(s))
Not helpful

Comments (0)