Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated to correctly use @@cacheByVars (not @@cacheByVar)

...

  1. Open your SuperGroup type (./packages/types/superGroup.cfc) and update the component metadata
    Code Block
    <cfcomponent
    
    	name="supergroup" extends="farcry.core.packages.types.types" output="false" displayname="Super Group"
    	bObjectBroker="true" objectbrokermaxobjects="1000">
    
  2. Open your SuperHero type (./packages/types/superHero.cfc) and update the component metadata
    Code Block
    <cfcomponent
    
    	name="superhero" extends="farcry.core.packages.types.types" output="false" displayname="Super Hero"
    	bObjectBroker="true" objectbrokermaxobjects="1000">
    
  3. Open your SuperPower type (./packages/types/superPower.cfc) and update the component metadata
    Code Block
    <cfcomponent 
    	name="superpower" extends="farcry.core.packages.types.types" output="false" displayname="Super Power"
    	bObjectBroker="true" objectbrokermaxobjects="1000">
    
  4. Re-initialize the application to get your component changes registered in the application (ie. Update App!)
  5. Wander about the website clicking on a few pages. This will activate the object broker and start caching objects behind the scenes.
  6. Open up the webtop ADMIN tab and review the Object Broker Report.

...

You can list the webskin templates by name, for example:

Code Block

lObjectBrokerWebskins="displayTeaserFeature,displayPageStandard"

You can list the webskin templates using a wildcard, for example:

Code Block

lObjectBrokerWebskins="display*"

You can nominate a specific timeout in minutes for each template, for example:

Code Block

lObjectBrokerWebskins="displayTeaserFeature:30,displayPageStandard:60"
Note
titleUsing Wildcards

Although using wildcards are great for caching whole sets of webskins, be careful. Best to be specific about your caching strategy; simplistic caching models can very quickly get you into trouble (wink)

...

There are two specific options for managing environmental cues for caching:

  • @@cacheByVar@@cacheByVars: used for any arbitrary variable you may wish to key the cache to.
  • @@cacheByRole@@cacheByRoles: used to key webskin caches by security roles, to accommodate changes different privileged access to be cached in the presentation tier
    Warning
    titleDeprecated Options

    The following inline template metadata options have been deprecated as of 5.1: @@cacheByURL, @@cacheByForm, @@hashURL. These are all replaced by the

...

  • @@cacheByVars metadata option. @@cacheByRoles is simply a boolean, so set it to 0 or 1.

Note
titleUsing cacheByVars

To correctly set the cache, you need to specify the full variable name. So, if you want to cache according to a url parameter (such as 'page') you need to set

Code Block

@@cacheByVars: url.page

Walkthrough: Add Caching to Super Hero

...