Warning | ||
---|---|---|
| ||
These are notes during the beta cycle only and are not complete – examples may not reflect best practice with respect to the final release of the 4.0 code base. |
Broker Overview
The object broker is a super piece of caching technology for the integrated ORM of FarCry Core. In simple terms it speeds up the access to data in the database by only retrieving the data once, then using in memory storage to provide fast access for subsequent requests. You really want to turn this on. The goodness provided is only limited by the the memory available to your ColdFusion instance.
...
Code Block |
---|
<cfcomponent extends="farcry.core.packages.types.versions" displayname="Article"
hint="Standard article used in the site."
bObjectBroker="true"
objectbrokermaxobjects="10000"
lObjectBrokerWebskins="display*">
|
...
A list of webskins that should be cached. The default time timeout for any webskin cache is 1400 minutes (or 24 hours). This seems like a long time, but remember they get automatically flushed if content within the view is updated.
...
Code Block |
---|
lObjectBrokerWebskins="display*" |
You can nominate a specific timeout in minutes for each template, for example:
Code Block |
---|
lObjectBrokerWebskins="displayTeaserFeature:30,displayPageStandard:60" |
Dealing Pagination & other URL changes
In some cases you need the view to respond to changes on the URL. For example in the case of a paginated result set, you may be changing the displayed list of teasers based on a URL parameter such as &pg=2 This is often awkward for caching regimes as you really need to use a hash of the query string in order to be sure you are looking at the right cache.
You can have webskin caches dynamically keyed by a hash of the pages URL by including the @@hashURL template level metadata, for example:
Code Block |
---|
<!--- @@displayname: Article Pagination Rule --->
<!--- @@description: A bit of blurbage about what this rule can do. --->
<!--- @@author: Mat Bryant (mat@daemon.com.au)--->
<!--- @@hashURL: true --->
|
Note: you only have to include this directive inside the webskin that responds to the URL parameter. If this webskin is embedded inside another webskin the system will automatically determine what additional caches would need to be flushed in the event of a change in URL parameter.
Object Broker Webtop Report
You can check which content types have been activated for the object broker by running the Objectbroker Report in the webtop Admin section. This should indicate those content types using the objectbroker, there their maximum threshold and the current number of objects in the broker.
...