[Maypole] Maypole::View::TT patch
Bill Moseley
moseley@hank.org
Tue, 9 Mar 2004 05:25:34 -0800
On Mon, Mar 08, 2004 at 10:03:36PM -0800, Dave Ranney wrote:
> I realize that it's a bit early in the game for optimizations, but this
> one jumped out at me as obvious and easy to improve. Maypole::View::TT
> creates a new Template object for each request.
Have you looked at CDBI::Factory? I think it has some nice ideas for
caching. It maintains a hash of setup objects based on a site name
(instead of, say, class name) that's passed in through the environment.
That basically allows running the same code with multiple databases on
the same server process just by changing the site name.
Another thing to think about is the INCLUDE_PATH. I sometimes change
the path during a request. So you might want to store $include_path in
the cache and reset (restore) it each request to the defaults in case it
was changed in a previous request.
> _ Fix the error method to return "Not Found" instead of "Declined" when
> a template doesn't exist
Is that the error that was throwing me off? I had moved the templates
to the wrong location and when I made a request I got a 404 error
because the template was missing.
--
Bill Moseley
moseley@hank.org