RE: [coldbox:15842] Re: [cachebox-latest] How to easily disable/reenable caching?

To clarify a bit of terminology (which I was also using incorrectly), CFProvider is a provider, black hole is a store that is meant to be used with one of the two cacheBox providers.
The CFProvider uses CF9’s underlying EHCache implementation and relies on the built-in CF function cacheGetMetadata() to return object metadata.

The two CacheBox providers are Caching implementations written in CFML. Are you using CacheBox outside of the ColdBox framework? If not, you probably want to be using the CacheBoxColdBoxProvider, not the CacheboxProvider.

All that being said, I’m not sure why you’re getting metaData at all. The blackhole store doesn’t even create an indexer instance which is what actually returns metadata for CacheBox stores. I would actually expect a call to myCache.getCachedObjectMetaData() to error since it runs instance.objectStore.getIndexer().objectExists(arguments.objectKey) and getIndexer() returns void.

Can you introspect myCache a bit to determine if it was correctly replaced with the ColdBox provider using a blackhole store?

Also, how are you getting a reference to myCache? If you autowired the reference into a singleton, you may have an out-of-date reference to the old provider (which still wouldn’t explain the difference in metadata though)`



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

I switched my configuration around, so that myCache was declared as a blackhole. Then I restarted ColdFusion. Then I tested the site - the data is getting cached. Then I looked at the reports - myCache and a_blackhole_cache contain the same data, and have the same number of hits and misses.

So I think there might be a bug in the blackhole objectStore, or I am setting it up wrong. Maybe you can only have one cache that uses the CFProvider? Here are my two caches (reversed from my usual setup):

I also have a 3rd cache I haven’t done anything with, called sessionCache:

I noticed on the report that it contains the same data & hits/misses as the other two caches.

On your other question, yes I am using this outside of ColdBox. I am using it in a Model-Glue application.


Ryan I just saw this can you post your config.

Here is the whole config.

<?xml version="1.0" encoding="UTF-8"?>

Ok, your config does not validate against the schema. Did you validate it?

Here is the valid schema:

<?xml version="1.0" encoding="UTF-8"?>

<CacheBox xmlns:xsi=“












coldboxEnabled=“false” />


Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:


Ah, my bad. I saw that the default cache declaration accepted objectstore as an attribute so I just assumed my additional cache declarations did also. I didn’t even really notice they are completely different tags (DefaultConfiguration vs Cache).

Now that I’m using your updated XML, the blackhole cache is working as expected, thank you.

But is it odd that in the Cachebox reporting page, all the caches show the same data? Even on the blackhole cache report, it shows the same hits & misses that the other caches do.

Also my idea about replacing the regular cache with a blackhole cache to disable caching isn’t so great - because its hard to turn it back on. I can’t simply replace the blackhole cache with my regular cache, because there is no regular cache anymore. Its been overwritten with the blackhole cache.