What is the Branched Cache Structure?
Comet Cache stores cache files for each page on your site based on the
PROTOCOL://HOST/URI that it's caching, inside the default Comet Cache cache directory located at
wp-content/cache/comet-cache/cache/. This builds the cache using a logical 'branched cache structure', based on the structure of the pages on your site.
To see how this works, let's assume we have a post called "Sample Post" at the following URL:
http://example.com/2014/05/sample-post/. When someone visits that URL, Comet Cache will parse out the following parts using the PHP superglobals
From that information, Comet Cache will first check if there is an existing cache file to serve for that page. If none is found, it will build the cache file path, starting with the Comet Cache cache location (
wp-content/cache/comet-cache/cache/) and creating any necessary subdirectories to reflect the path of the URI.
In our example, the following subdirectories are created:
/05/, to give us a final cache path of:
Note: Several special characters (such as periods) are replaced with hyphens when building the cache path, so
The cache file for "Sample Post" is then written to a file called
sample-post is the last portion of the URI.
We then end up with the following cache file:
Comet Cache then loads and displays that cache file to each new visitor.