Changes between Version 1 and Version 2 of HowTos/HowToUseContentCaching

Show
Ignore:
Timestamp:
02/14/10 05:59:23 (16 years ago)
Author:
boomfish (IP: 174.96.5.149)
Comment:

Changed spelling of 'adaptor' to 'adapter' so as to match the code.

Legend:

Unmodified
Added
Removed
Modified
  • HowTos/HowToUseContentCaching

    v1 v2  
    4848The cacheTimeout argument sets how long the cached event-handler or included view remains in the cache.  By default this is 5 seconds.  You can override this value using the defaultCacheTimeout as documented earlier in this document.  Or, you can use the cacheTimeout argument on an event-handler or include tag to control how long this item is cached. 
    4949 
    50 == The Beans Scope and the !CacheAdaptor == 
     50== The Beans Scope and the !CacheAdapter == 
    5151 
    52 Model-Glue uses a component known as a !CacheAdaptor to cache data.  The !CacheAdaptor is placed in the beans scope for all Controllers and is easily accessible there.  As an example, to dump this object you could ad this code within a controller: 
     52Model-Glue uses a component known as a !CacheAdapter to cache data.  The !CacheAdapter is placed in the beans scope for all Controllers and is easily accessible there.  As an example, to dump this object you could ad this code within a controller: 
    5353{{{ 
    54 <cfdump var="#beans.CacheAdaptor#" /> 
     54<cfdump var="#beans.CacheAdapter#" /> 
    5555}}} 
    56 This object provides functions you can use to interact with the !CacheAdaptor.  You can, for example, purge the cache, add values, etc.  In fact, the legacy !AddToCache, !ExistsInCache, !GetFromCache,  and !RemoveFromCache functions on the controller simply access the beans-scoped !CacheAdaptor. 
     56This object provides functions you can use to interact with the !CacheAdapter.  You can, for example, purge the cache, add values, etc.  In fact, the legacy !AddToCache, !ExistsInCache, !GetFromCache,  and !RemoveFromCache functions on the controller simply access the beans-scoped !CacheAdapter. 
    5757 
    58 For complete details on the functions on the !CacheAdaptor see the API documentation. 
     58For complete details on the functions on the !CacheAdapter see the API documentation. 
    5959== Creating Custom Caching Systems == 
    6060 
    6161Model-Glue's built in caching system is intentionally simple.  It simply puts items into a component in the application scope.  If you need something more complex you can implement your own caching system. 
    6262 
    63 By creating your own !CacheAdaptor you could, for example, make use of Memcached or JDBM for an enterprise class caching system. 
     63By creating your own !CacheAdapter you could, for example, make use of Memcached or JDBM for an enterprise class caching system. 
    6464 
    65 To do this, you will need to create your own !CacheAdaptor by either extending the 
     65To do this, you will need to create your own !CacheAdapter by either extending the 
    6666!ModelGlue.gesture.externaladapters.contentcaching.!SimpleTimedCache or simply implement the !ModelGlue.gesture.externaladapters.contentcaching.!IContentCache interface. 
    6767 
    68 Once you've created your cache adaptor you simply need to write it in.  To do so you will need to add a !ColdSpring bean in your !ColdSpring configuration file with an ID of "modelglue.cacheAdapter".  Here's a basic example: 
     68Once you've created your cache adapter you simply need to write it in.  To do so you will need to add a !ColdSpring bean in your !ColdSpring configuration file with an ID of "modelglue.cacheAdapter".  Here's a basic example: 
    6969{{{ 
    70 <bean id="modelGlue.cacheAdapter" class="Model.cache.ExampleCacheAdaptor"> 
     70<bean id="modelGlue.cacheAdapter" class="Model.cache.ExampleCacheAdapter"> 
    7171  <!-- my configuration properties would go here --> 
    7272</bean> 
    7373}}} 
    74 When you restart your Model-Glue application it will start using your new, custom, !CacheAdaptor. 
     74When you restart your Model-Glue application it will start using your new, custom, !CacheAdapter.