...
Note |
---|
The objectbroker cache is stored per application. In clustered solutions its possible for application instances to get out of synch. Daemon has a commercial plugin for the FarCry Platform to help provide high availability in clustered solutions: FarCry HA Plugin. |
Activating Object Broker
The Object Broker is activated by adding component level metadata to your content type.
Code Block |
---|
<cfcomponent extends="farcry.core.packages.types.versions" displayname="Article"
hint="Standard article used in the site."
bObjectBroker="true"
objectBrokerMaxObjects="10000">
|
bObjectBroker
Setting this to true
activates object-level caching for the specific content type. The default if you do not specify this attribute is false
.
objectBrokerMaxObjects
The maximum number of objects to be held in the Broker for this content type. The default if you do not specify this attribute is 100
. Typically you want to set this to a number that is high enough to hold all the records for this content type. The only reason not to is if you lack enough physical memory on the ColdFusion instance to accommodate them.
Object Broker Report
You can check which content types have been activated for the Object Broker by running the Object Broker Report under the webtop Admin tab, Cache Management menu. This should indicate those content types using the Object Broker, their maximum threshold and the current number of objects in the Broker.
Walkthrough: Activating the Object Broker for Content Types
Let's activate the Broker for the three content types we created earlier; superHero, superGroup and superPower.
- Open your Super Group 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">
- Open your Super Hero 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">
- Open your Super Power 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">
- Re-initialize the application to get your component changes registered in the application (ie. Update App!)
- Wander about the website clicking on a few pages; this will activate the Object Broker and start caching objects behind the scenes
- Open up the webtop Admin tab and review the Object Broker Report
View Caching
You can also cache the view layer very easily, by specifying a caching directive in the webskin's decorator.
Note | ||
---|---|---|
| ||
Do not use |
...