Hi,
I need to associate CIs to a specific Channel with in a single Site based on few requirements. I have configured a listener appropriately and the code works fine.
I am facing performance issues with my code. The association part works well but the code that is used to obtain necessary Channel object takes up long time to execute. I do somthing along the following lines -
Site site=Site.findByName("MySite");
Channel home=site.getHomeChannel();
Channel[] subChannels = home.getAllSubchannels(RequestParameters
.getImmutableInstanceTopRelationOnly());
Channel associate=findChannel(subChannels);
The findChannel traverses all channels (and sub-channels) to fetch appropriate Channel. Specifically channel.getAllSubchannels(RequestParameters.getImmutableInstanceTopRelationOnly()) takes up a from 1-10 seconds to execute. I tried using com.vignette.ext.templating.util.ContentUtil.getSubchannels(home) variant for the same operation. But as i do not have DSM/DPM configured i get error as system tries to init VgnExTemplating resource - com.vignette.as.config.ConfigUtil.getGenericResourceValue - so i guess I cannot use this API.
I am thinking of using some in-memory cache alternative like EHCache, which i'll build on-demand basis and store channel Path as Key and the Channel object as the value for faster access.
I need to know if this is a wise decision. As Channel objects will be maintained in my in-memory cache, will these objects be some how invalidated incase the Channel is some how modified through AppConsole or some other way.
Is there a way I can access specifc channels faster? Please guide id above is not an appropriate route.
Thanks, Amit