Whatever message this page gives is out now! Go check it out!
component{
this.name = "appSpecificCacheTest";
this.cache.configfile = "jcsconfig.properties";
this.cache.engine = 'jcs';
this.applicationTimeout = createtimespan(0,0,0,5);
}maxElementsInMemory=5
eternal=false
timeToIdleSeconds=30
timeToLiveSeconds=5<cfscript>
writedump(cacheGetEngineProperties()); // Returns the cache engine properties
writeoutput(cacheGetEngineProperties().name); // Returns the name of the cache engine
</cfscript># MYSQL disk cache used for flight options
jcs.auxiliary.MYSQL=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
jcs.auxiliary.MYSQL.attributes=org.apache.commons.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
jcs.auxiliary.MYSQL.attributes.userName=<user name>
jcs.auxiliary.MYSQL.attributes.password=<password>
# Make sure the datasource is the one in which JCS_STORE is created
# via the Administrator
jcs.auxiliary.MYSQL.attributes.url=jdbc:mysql://localhost:3306/<datasource>
jcs.auxiliary.MYSQL.attributes.driverClassName=com.mysql.jdbc.Driver
jcs.auxiliary.MYSQL.attributes.tableName=JCS_STORE
jcs.auxiliary.MYSQL.attributes.UseDiskShrinker=falsejcs.default = MYYSQL in cache.ccf.memcachedmaxElementsInMemory=5
eternal=false
timeToIdleSeconds=30
timeToLiveSeconds=5// Application.cfc
component{
this.name='appUsingMemcached';
this.cache.engine='memcached';
this.cache.configFile='memcachedconfig.properties';
this.cache.applicationTimeout=createtimespan(0,0,0,5);
}// memcachedconfig.properties
maxElementsInMemory=5
eternal=false
timeToIdleSeconds=30
timeToLiveSeconds=10redis-servermaxElementsInMemory=5
eternal=false
timeToIdleSeconds=30
timeToLiveSeconds=5<!--- Application.cfc --->
<cfcomponent>
<cfscript>
this.name = "appSpecificCacheTest";
this.cache.configfile = "redisconfig.properties";
this.cache.engine = "redis";
this.applicationTimeout = createtimespan(0,0,0,5);
</cfscript>
</cfcomponent>// redisconfig.properties
maxElementsInMemory=5
eternal=false
timeToIdleSeconds=30
timeToLiveSeconds=5<cfcomponent implements="ICustomCache">
<cffunction name="put" >
<cfargument name="obj" type="struct">
<cfoutput>"inside put"</cfoutput>
<cfset defaultCache=Application.defaultCacheManager.getcache()>
<cfset defaultCache.put(obj.id,#obj.value#)>
</cffunction>
</cfcomponent><infinispan>
<cache-container default-cache="local">
<local-cache name="local"/>
</cache-container>
</infinispan><cfcomponent>
<cfset this.name= "xyz">
<cfscript>
function onApplicationStart()
{
writelog("In onApplicationStart()");
Application.defaultCacheManager=CreateObject("java","org.infinispan.manager.DefaultCacheManager").init('C:\ColdFusion2021\cfusion\wwwroot\custom_cache\config.xml');
writelog("In onApplicationStart()");
}
function onApplicationEnd() {
writelog("In onApplicationEnd()");
}
</cfscript>
</cfcomponent>// Application.cfc
<cfcomponent>
<cfscript>
this.name = "mycache_app";
this.cache.engine = "mycache";
</cfscript>
</cfcomponent>void verifyRedisCacheStorageConnection (sessionStorageHost, numeric sessionStoragePort, sessionStoragePassword)Parameter | Req/Opt | Default | Description |
sessionStorageHost | Optional | Any | The hostname for Redis cache storage. |
sessionStoragePort | Optional | Numeric | The port number for Redis cache storage. |
sessionStoragePassword | Optional | Any | The password for the Redis cache storage. |
void setServerCachingEngine (required engine)Parameter | Req/Opt | Default | Description |
engine | Required | Any | 1. Ehcache 2. JCS 3. Memcached 4. Redis |
void setJCSClusterDsnName (required dsn, required boolean createTables)Parameter | Req/Opt | Default | Description |
dsn | Required | Any | Name of the data source. |
createTables | Required | Any | Whether to create a table. |
void setCachingRedisServer (required host, required port, required password, required boolean cluster)Parameter | Req/Opt | Default | Description |
host | Required | any | Host address of the server. |
port | Required | any | Port number of the server. |
password | Required | any | Password of the server. |
cluster | Required | Boolean | Whether a cluster is enabled in Redis. |
any getMemcachedServer ()