Pre-Caching multiple items using "criteria"

0 views
Skip to first unread message

cheesecow

unread,
May 13, 2008, 6:09:25 PM5/13/08
to Mach-II for ColdFusion
Searched around a bit and couldn't find the answer so here goes. I'm
going to be periodically updating items in a store from a external
data source which would need to blow away all the old items and reload
the updated inventory. I would like to be able to "pre-load" each of
the items into the cache rather than having users go through calling
the event and waiting for it to do its initial cache based on the item
guid. I was thinking of exposing the caching layer thru a listener and
then using the put in the cachestrategy to insert each item into the
cache, is there a better way to do this?

Kurt Wiersma

unread,
May 14, 2008, 7:15:07 PM5/14/08
to mach-ii-for...@googlegroups.com
In Mach II 1.6 BER you can use the new UtilityConnector.cfc to give your services access to the Mach II CacheManger where you can access the cache that you configured and then populate it with data through your service calls. Depending on how you set this up there might be a issue determining the right key in the cache to populate for your Mach II event handlers. We might be willing to change this if it is a populater request.

I know you want to be able to "pre-load" on application start up but I have found that doing that can cause your application start up time to get really long as amount of stuff you want to preload grows. Would it be possible to simply populate the cache the first time someone runs the event-handler? The other idea would be to create a data cache in your service layer and pre-populate that. You could use Mach II's caching strategies inside your service to cache the data and then have your listener call that service to retrieve the data.

--Kurt

Matt Williams

unread,
May 16, 2008, 12:12:09 AM5/16/08
to mach-ii-for...@googlegroups.com
You could also consider using something like Selenium to automatically
run through the events that are to be cached. You could probably even
make onApplicationStart call a Selenium script to run this.

Just an idea...


--
Matt Williams
"It's the question that drives us."

cheesecow

unread,
May 19, 2008, 4:18:46 PM5/19/08
to Mach-II for ColdFusion
Thanks thats along the lines of what i was looking for

On May 15, 9:12 pm, "Matt Williams" <mgw...@gmail.com> wrote:
> You could also consider using something like Selenium to automatically
> run through the events that are to be cached. You could probably even
> make onApplicationStart call a Selenium script to run this.
>
> Just an idea...
>
> --
> Matt Williams
> "It's the question that drives us."
>
> On Wed, May 14, 2008 at 6:15 PM, Kurt Wiersma <kwier...@gmail.com> wrote:
> > In Mach II 1.6 BER you can use the new UtilityConnector.cfc to give your
> > services access to the Mach II CacheManger where you can access the cache
> > that you configured and then populate it with data through your service
> > calls. Depending on how you set this up there might be a issue determining
> > the right key in the cache to populate for your Mach II event handlers. We
> > might be willing to change this if it is a populater request.
> > I know you want to be able to "pre-load" on application start up but I have
> > found that doing that can cause your application start up time to get really
> > long as amount of stuff you want to preload grows. Would it be possible to
> > simply populate the cache the first time someone runs the event-handler? The
> > other idea would be to create a data cache in your service layer and
> > pre-populate that. You could use Mach II's caching strategies inside your
> > service to cache the data and then have your listener call that service to
> > retrieve the data.
> > --Kurt
>
Reply all
Reply to author
Forward
0 new messages