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

If you were using ColdBox, I’d recommend swapping out the WireBox mapping for your cache on-the-fly. Since you’re in MachII, I’d say perhaps a utility method like so:

function getMyCache() {

return cacheBox.getCache(“theRealOne”);

else {
return cacheBox.getCache(“theFakeOne”);


Then, just call getMyCache() any time you want the appropriate caching provider. That way, both providers are always configured, you’re just changing which one you reference.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: