CacheBox: Enterprise Caching
7.x
7.x
  • Introduction
    • Contributing Guide
    • Release History
      • What's New With 7.2.0
      • What's New With 7.1.0
      • What's New With 7.0.0
    • Upgrading to CacheBox 7
    • About This Book
      • Author
  • Getting Started
    • Overview
    • Installing CacheBox
    • Creating CacheBox
      • Common CacheFactory Methods
      • Cache Cleanup/Reaping
  • Configuration
    • CacheBox Configuration
      • CacheBox DSL
        • Default Cache
      • CacheBox Config Object
      • ColdBox Configuration
  • Usage
    • Cache Providers
      • CF Providers
      • Lucee Providers
      • Mock Provider
      • CacheBox Provider
      • Couchbase Providers
    • CacheBox Object Stores
      • ConcurrentStore
      • ConcurrentSoftReferenceStore
      • DiskStore
      • JDBCStore
      • BlackholeStore
  • Advanced Usage
    • CacheBox Eviction Policies
      • Using Your Own Policy
    • CacheBox Event Model
      • CacheBox Events
      • Provider Events
      • Cache Listeners
    • Cache Reporting
      • Creating Your Own Skins
        • Skin Templates
        • ReportHandler
          • Action Commands
  • For The Geeks
    • Caching Concepts
      • Caching Considerations
      • Cache Loading
      • Definitions
      • Java Soft References
    • Cache Topologies
      • Single Instance/In-Process
      • Single Instance/Out-Process
      • Replicated
      • Distributed
    • CacheBox Architecture
      • CacheFactory
      • CacheBoxConfig
      • EventManager
      • ColdBox
      • LogBox
      • ICacheProvider
      • ICacheStats
      • IObjectStore
      • IEvictionPolicy
      • AbstractEvictionPolicy
      • IColdboxApplicationCache
Powered by GitBook
On this page
  • Default Configuration
  • Custom Configuration

Was this helpful?

Edit on GitHub
Export as PDF
  1. Configuration
  2. CacheBox Configuration

ColdBox Configuration

Default Configuration

The default configuration file for CacheBox within ColdBox applications can be found here

/coldbox/system/web/config/CacheBox.cfc

This configuration file configures CacheBox with two caches:

  • default

  • template

The default cache can be used for any type of data caching or object persistence. The template cache is used for event caching and view fragment caching. It is also important to note that the template cache uses the ConcurrentSoftReferenceStore for its objects and the default cache uses the ConcurrentStore for its objects.

This means that event/view caching is subject to available memory via the JVM, a memory sensitive cache. This is essential as you could have lots of events being cached and you want to be considerate with memory concerns. It is also limited to 300 objects.

Now, this is all nice and dandy, but what if I want to configure CacheBox "MY WAY!!"? Well, don't shout, we are just getting there. There are several ways you can configure CacheBox from within your applications, so chose wisely.

Custom Configuration

ColdBox allows for a programmatic approach via the ColdBox configuration object: Coldbox.cfc. So let's look at how the framework loader looks at your configuration for CacheBox configuration details:

  • Is there a cachebox DSL variable defined in the configuration structure?

  • False:

    • Does a CacheBox.cfc exist in the application's config folder?

      • True : Use that for configuration

      • False: Configure CacheBox with default framework settings found in /coldbox/system/web/config/CacheBox.cfc

  • True:

    • Have you defined a configFile key in the cacheBox DSL structure?

      • True: Then use that value to pass into the configuration object so it can load CacheBox using that configuration CFC

      • False: The configuration data (CacheBox DSL) is going to be defined inline here so use that structure for configuration

Info The configuration DSL is exactly the same as you have seen in before with the only distinction that you can add a configFile key that can point to an external configuration CFC.

cacheBox = {
    configFile = "mypath.config.CacheBoxConfig"
};

That's it folks! You can either write inline CacheBox DSL configuration, use by convention a CacheBox.cfc data CFC or use a configFile approach for external file loading. Pick your poison!

PreviousCacheBox Config ObjectNextCache Providers

Last updated 2 years ago

Was this helpful?