Introduction to
CacheBox 101
--& --
LogBox 101
Brad Wood
www.codersrevolution.com
brad@coldbox.org
@bdw429s
Who Am I?
● ColdFusion Architect (12 years)
● Geek
● Android Lover
● Blogger (codersrevolution.com)
● ColdBox Platform Evangelist
● Musician
● Shade-Tree Mechanic
● Husband (16 years)
● Dad (3 beautiful girls)
What is Caching?
What is CachBox?
CacheBox is an enterprise caching engine,
aggregator, and API for ColdFusion applications.
Where can it be used?
It is part of the ColdBox Platform but it can also
function on its own as a standalone framework.
What is a Cache Aggregator?
● Ability to aggregate different caching engines
● Ability to aggregate different configurations of
the same caches
● Consistent API for all caches
● Swap out backend caching implementation
What is a Cache Aggregator?
Features
● No need to create it, configure it or manage it if
used within a ColdBox Application
● Multi-Threaded
● Based on Java Concurrency Classes
● Memory Management & Memory Sensitive caching
based on Java Soft References
● Multiple Eviction Policies: LRU, LFU and FIFO
● High Load Tested
● Fully Documented
Highly Configurable
● JVM Threshold Checks
● Object count limits
● Objects time based expirations
● Purging based on object usage (Access Timeouts)
Visually Appealing and Useful
What Caches are Supported?
● CF Provider (EHCache)
● Lucee Provider
● In-memory Provider (CacheBox)
● Couchbase
● Redis
● Memcached
● Disk Store
● DB Store (JDBC)
Basic API
Cache Operations
● get(key)
● set(key,value)
● lookup(key)
● clear(key)
● getOrSet( key, UDF )
ColdBox View Caching
<coldbox.cfc>
coldbox.viewCaching = true;
event.setView(name='home',cache=true,cacheTimeout=30);
<cfoutput>
#renderView(view='tags/footer',cache=true,cacheTimeout="60")#
</cfoutput>
event.setView(
name='home',
cache=true,
cacheTimeout=30,
cacheSuffix=rc.language);
ColdBox Event Caching
<coldbox.cfc>
coldbox.eventCaching = true;
function showEntry(event,rc,prc) cache="true" cacheTimeout="30" {
//get Entry
prc.entry = getEntryService().getEntry();
//set view
event.setView('blog/showEntry');
}
CacheBox Questions
What is LogBox?
● LogBox is an enterprise ColdFusion logging
library
● Inspired by Log4J (A Java logger made by
Apache)
● LogBox is part of ColdBox or can be used as
a stand-alone logging library.
Message Severities
4 (Default LevelMax)DEBUG
3INFO
2WARN
1ERROR
0 (Default LevelMin)FATAL
Integer LevelSeverity
Where Do I Use It?
Log messages can come from anywhere
in your application.
● Logs from the framework (coldbox.system)
● Specific component
(com.example.order.orderService)
● Package (com.example.security)
● Ad-hoc locations (“nightly-scheduled-task”)
Where Do The Messages Go?
● Files (async)
● Emails
● Databases
● BuglogHQ
● Sentry
● Rollbar
● Raygun.io
● Slack
● Pingdom
Custom Logging Levels
● Turn debugging of certain services on only
when you need it (WireBox debugging)
● Log information or debug messages only
on dev server, but not in production
● Only store logs from certain parts of your
framework
LogBox Questions

ITB2019 CacheBox + LogBox 101 - Brad Wood

  • 1.
    Introduction to CacheBox 101 --&-- LogBox 101 Brad Wood www.codersrevolution.com brad@coldbox.org @bdw429s
  • 2.
    Who Am I? ●ColdFusion Architect (12 years) ● Geek ● Android Lover ● Blogger (codersrevolution.com) ● ColdBox Platform Evangelist ● Musician ● Shade-Tree Mechanic ● Husband (16 years) ● Dad (3 beautiful girls)
  • 3.
  • 4.
    What is CachBox? CacheBoxis an enterprise caching engine, aggregator, and API for ColdFusion applications.
  • 5.
    Where can itbe used? It is part of the ColdBox Platform but it can also function on its own as a standalone framework.
  • 6.
    What is aCache Aggregator? ● Ability to aggregate different caching engines ● Ability to aggregate different configurations of the same caches ● Consistent API for all caches ● Swap out backend caching implementation
  • 7.
    What is aCache Aggregator?
  • 8.
    Features ● No needto create it, configure it or manage it if used within a ColdBox Application ● Multi-Threaded ● Based on Java Concurrency Classes ● Memory Management & Memory Sensitive caching based on Java Soft References ● Multiple Eviction Policies: LRU, LFU and FIFO ● High Load Tested ● Fully Documented
  • 9.
    Highly Configurable ● JVMThreshold Checks ● Object count limits ● Objects time based expirations ● Purging based on object usage (Access Timeouts)
  • 10.
  • 11.
    What Caches areSupported? ● CF Provider (EHCache) ● Lucee Provider ● In-memory Provider (CacheBox) ● Couchbase ● Redis ● Memcached ● Disk Store ● DB Store (JDBC)
  • 12.
    Basic API Cache Operations ●get(key) ● set(key,value) ● lookup(key) ● clear(key) ● getOrSet( key, UDF )
  • 13.
    ColdBox View Caching <coldbox.cfc> coldbox.viewCaching= true; event.setView(name='home',cache=true,cacheTimeout=30); <cfoutput> #renderView(view='tags/footer',cache=true,cacheTimeout="60")# </cfoutput> event.setView( name='home', cache=true, cacheTimeout=30, cacheSuffix=rc.language);
  • 14.
    ColdBox Event Caching <coldbox.cfc> coldbox.eventCaching= true; function showEntry(event,rc,prc) cache="true" cacheTimeout="30" { //get Entry prc.entry = getEntryService().getEntry(); //set view event.setView('blog/showEntry'); }
  • 15.
  • 16.
    What is LogBox? ●LogBox is an enterprise ColdFusion logging library ● Inspired by Log4J (A Java logger made by Apache) ● LogBox is part of ColdBox or can be used as a stand-alone logging library.
  • 17.
    Message Severities 4 (DefaultLevelMax)DEBUG 3INFO 2WARN 1ERROR 0 (Default LevelMin)FATAL Integer LevelSeverity
  • 18.
    Where Do IUse It? Log messages can come from anywhere in your application. ● Logs from the framework (coldbox.system) ● Specific component (com.example.order.orderService) ● Package (com.example.security) ● Ad-hoc locations (“nightly-scheduled-task”)
  • 19.
    Where Do TheMessages Go? ● Files (async) ● Emails ● Databases ● BuglogHQ ● Sentry ● Rollbar ● Raygun.io ● Slack ● Pingdom
  • 20.
    Custom Logging Levels ●Turn debugging of certain services on only when you need it (WireBox debugging) ● Log information or debug messages only on dev server, but not in production ● Only store logs from certain parts of your framework
  • 21.