Skip to content

Instantly share code, notes, and snippets.

@nolandubeau
Created May 1, 2013 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolandubeau/5496498 to your computer and use it in GitHub Desktop.
Save nolandubeau/5496498 to your computer and use it in GitHub Desktop.
Cachebox settings
<!-----------------------------------------------------------------------
********************************************************************************
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
www.coldbox.org | www.luismajano.com | www.ortussolutions.com
********************************************************************************
Author : Luis Majano
Description :
CacheBox configuration structure
----------------------------------------------------------------------->
<cfcomponent output="false">
<cfscript>
/**
* Configure CacheBox for ColdBox Application Operation
*/
function configure(){
// The CacheBox configuration structure DSL
cacheBox = {
// LogBox config already in coldbox app, not needed
// logBoxConfig = "coldbox.system.web.config.LogBox",
// The defaultCache has an implicit name "default" which is a reserved cache name
// It also has a default provider of cachebox which cannot be changed.
// All timeouts are in minutes
defaultCache = {
objectDefaultTimeout = 120, //two hours default
objectDefaultLastAccessTimeout = 30, //30 minutes idle time
useLastAccessTimeouts = true,
reapFrequency = 2,
freeMemoryPercentageThreshold = 0,
evictionPolicy = "LRU",
evictCount = 1,
maxObjects = 300,
objectStore = "ConcurrentStore", //guaranteed objects
coldboxEnabled = true
},
// Register all the custom named caches you like here
caches = {
// Named cache for all coldbox event and view template caching
template = {
provider = "coldbox.system.cache.providers.CacheBoxColdBoxProvider",
properties = {
objectDefaultTimeout = 120,
objectDefaultLastAccessTimeout = 30,
useLastAccessTimeouts = true,
freeMemoryPercentageThreshold = 0,
reapFrequency = 2,
evictionPolicy = "LRU",
evictCount = 2,
maxObjects = 300,
objectStore = "ConcurrentSoftReferenceStore" //memory sensitive
}
},
// JDBC Cache
database = {
provider = "coldbox.system.cache.providers.CacheBoxColdBoxProvider",
properties = {
objectDefaultTimeout = 120,
objectDefaultLastAccessTimeout = 30,
useLastAccessTimeouts = true,
reapFrequency = 5,
evictionPolicy = "LRU",
evictCount = 5,
maxObjects = 1000,
objectStore = "JDBCStore",
dsn =application.dsn,
table = "cachebox",
tableautocreate = "false"
}
}
}
};
}
</cfscript>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment