Caching for findBySlug - Overwrite method from another module?

Hi @all,

out of some pages and their children I´m generating a custom view. The pages are disabled, have no own URL. The content is shown on some pages.

pages = cb.getPageService().findBySlug('xxx', true).getChildren();

So I am not using the render method to display the content. I grab some stuff out of the pages and display it an a view. So I have no caching at all.

What would be cool is to overwrite the method findBySlug(). An optional parameter could then decide, if the result should be cached or not.
Is there a nice way to overwrite the method out of another module? I do not want to change the core or write an plugin.



This is probably your best and easiest solution, but the content is not cached there, nor would it be practical to try and cache it there either.

Another option is just to write a service of your own that proxies to the ContentBox services but employs the caching for you.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform:

Andy, you have full access to the API when you install COntentBox. Why not create your own PageService that does whatever you need and decorates the core page service?


Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform:
Linked In:
IECFUG Manager:


Hi, today I checked the article about AOP. For me it seems to be the best solution. After some testing caching is done very smart…

So no other service is needed, just a binding and the rest is straight forward.

Support here is great and you always offer many possible solutions.

Cheers Andy