Plugins and view cacheing - how?

We have a simple plugin which creates a new type, and has a straightforward webskin which we would like to cache. We’ve added the cache directives to it’s displayPageStandard.cfm:

<cfsetting enablecfoutputonly=true />
<!--- @@cacheStatus: 1 --->
<!--- @@cacheTimeout: 60 --->

We can call an instance of the type directly using its friendly URL, however, when I check the “Cache Summary” in the webtop, the view does not appear to be cached? It does appear to show something cacheing from the main project, but not from the plugins… is there something else we need to do to get it to work?

You can’t cache a content item’s view unless the content type is registered for use in the ObjectBroker. This is set by adding a CFCOMPONENT level metadata attribute for bObjectbroker="true" to your content type.

For example, a custom content type in the recently released FarCry Core public website skeleton project:

	displayname="Raw HTML Page" extends="farcry.core.packages.types.types"
	bFriendly="true" bObjectBroker="true" bUseInTree="true"
	hint="A raw HTML Page content type for advanced users to hand build the HTML markup of a page">

Another option you might consider is increasing the maximum number of objects to be brokered with objectbrokermaxobjects="1000".

Theres a full list of metadata options available here:

The best place to get an overview of how a specific view or composite of views is the webskin tracer utility available from the FarCry toolbar:

The webskin tracer will indicate in purple that a specific view is not in the objectbroker or red to show that its been deliberately excluded from the cache.

1 Like

OK… the type is in the object broker, and when I check the profiler, it does indeed say that it is cacheing:

* Caching for 0 day(s), 1 hour(s), 0 minute(s).

…I think it’s me looking in the wrong place then - I was expecting the content cache to appear under the “Cache Summary” option in the webtop, but are type webskins all shown in the “Object Broker Report” (just noticed the webskin button!)?

I have a feeling that type webskins might fall under farCOAPI as they are not specifically bound to an individual content item/object.

The Object broker report probably needs some serious love. It’s main purpose is to determine how you might adjust the number of objects per type in the broker’s cache. Life is a bit more sophisticated in the cache since the report was originally written.