Bypassing AIM relation management

Release 1.0 - ...

As you know, AIM registration ensures correct state invalidation. There are cases however where you can optimize the AIM handling a bit.

Consider a large sitemap that you want to cache in memory, using the cache macro.

Smartsite SXML CopyCode image Copy Code
<se:cache>
 <se:sitemap maxlevels="10" startitem="home"/>
</se:cache>

SiteMap is aim-aware, and will add ItemToFolder relations for all displayed folders.

Depending on the size of the site, many aim references will be added and will be monitored on CMS updates.

Now think. In a case where virtually any CMS update under the HOME folder will affect our cache, do we need to use this approach?

No, there's a smarter way. AIM exposes special event binding methods that you can use within the cache macro:

We can thus rewrite our code to simply bind to CMS updates, like this:

Smartsite SXML CopyCode image Copy Code
<se:cache>
 {aim.events.bindtocontentchange('HOME')}
 <se:sitemap maxlevels="10" startitem="home" aim="off"/>
</se:cache>