Cache Reporting
CacheBox comes with great reporting tools whether you are using it within a ColdBox application or standalone. This section deals with how to do a-la-carte reporting by using the custom tags that CacheBox ships with. Below is the simplest form of usage for the monitor reporting tags:
1
<cfimport prefix="cachebox" taglib="/cachebox/system/cache/report">
2
3
<--- Create CacheBox with default configuration --->
4
<cfif structKeyExists(url,"reinit") OR NOT structKeyExists(application,"cacheBox")>
5
<cfset application.cacheBox = new cachebox.system.cache.CacheFactory()>
6
<cfelse>
7
<cfset cachebox = application.cacheBox>
8
</cfif>
9
10
<cfoutput>
11
<html>
12
13
<head>
14
<title>CacheBox Monitor Tool</title>
15
</head>
16
<body>
17
18
<--- Special ToolBar --->
19
<div id="toolbar">
20
<input type="button" value="Reinit" onclick="window.location='index.cfm?reinit'"/>
21
</div>
22
23
<--- Render Report Here --->
24
<cachebox:monitor cacheFactory="#cacheBox#"/>
25
26
</body>
27
</html>
28
</cfoutput>
Copied!
That's it! You basically import the tag library from /cachebox/system/cache/report and then use the monitor tag to render out the monitor. What's cool about the monitor is that it is completely skinnable. Please see the CacheBox Report Skins for more information.

Reporting Attributes

Let's check out the attributes for this custom tag:
Attribute
Type
Required
Default
Description
cacheFactory
cachebox.system.cache.CacheFactory
true
---
The reference to the CacheBox factory to report on.
baseURL
string
false
cgi.script_name
The location of the script so the tag can create links for Ajax calls and rendering calls.
skin
string
false
default
The name of the skin to use for rendering the report. The skins are found at /cachebox/system/cache/report/skins
Info Each skin can implement its own attributes, so always check the skins documentation to see what extra attributes it implements.
Here are some examples of the tag usage:
1
<cachebox:monitor cacheFactory="#cacheBox#"/>
2
3
<cachebox:monitor cacheFactory="#cacheBox#" baseURL="index.cfm?event=cacheMonitor"/>
4
5
<cachebox:monitor cacheFactory="#cacheBox#" skin="coolskin"/>
6
7
<--- Embedding report in a coldbox application's admin view --->
8
<cachebox:monitor cacheFactory="#controller.getCacheBox()#"
9
baseURL="#event.buildLink(event.getCurrentEvent())#" />
Copied!
Copy link