[Catalyst] preloading stashed variables

Sebastian Riedel sri at oook.de
Thu Apr 7 10:52:01 CEST 2005


Am 07.04.2005 um 08:32 schrieb Eugene Eric Kim:

> I'm using 4.34 right now, although I suspect this applies to 5 as
> well.  I'd like to instantiate a few objects when my application first
> starts up, and have those objects stay persistent and accessible
> throughout the lifespan of the application.  My thinking was that I
> would store those objects in stash.  My question is, where do I
> instantiate those objects?  If I instantiate them in !begin, then
> those objects will be instantiated every time an action is called, no?

The whole context $c gets reinstantiated on every request, so you can't 
store it in the stash.
begin is also called on every request.

Models, Views, Controllers and Plugins are instantiated at startup.
I guess your objects fit in one of those categories. :)

--
sebastian




More information about the Catalyst mailing list