in reply to mySQL hits or Storable retrieves?

It's past midnight, so my mental capacity is going to rapidly approach that of a pumpkin, so take this all with a sprinkle of salt.

The answer to question 4 (are you making it too complicated?), is probably yes. Grab your HTML::Template man-page, and do a search for "file_cache". Here's one I prepared earlier:

file_cache - if set to 1 the module will store its cache in a file using the Storable module. It uses no additional memory, and my simplistic testing shows that it yields a 50% performance advantage. Like shared_cache, it will work in a CGI environment. Default is 0.
Now isn't that neat? HTML::Template already knows about the Storable module, and the comments underneath make note about it using flock() to make sure everything behaves. (Regular caveat about file-locking being broken on NFS applies.)

Hope that you find the above useful.

Cheers,
Paul

Replies are listed 'Best First'.
Re: Re: mySQL hits or Storable retrieves?
by Hero Zzyzzx (Curate) on Oct 02, 2001 at 18:25 UTC

    One other clarification: I'm using HTML::Template's cache features, storing parsed templates in memory. BTW, I think the caching provided by HTML::Template only stores the parsed templates, not the data, into memory. This doesn't help me, I'm talking about storing the data structures.

    I wouldn't want HTML::Template to store my data in memory. I'd rather manage that, and when it needs to change, myself.

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.

      When I put up the warning about my mental capabilities approaching that of a pumpkin, I meant it. I woke up this mroning thinking exactly the same thing (you want to cache the data, not the template). Doh!

      The suggestions I would have given if I had been thinking have already been mentioned, so I won't repeat them here.

      Cheers,
      Paul

Re: Re: mySQL hits or Storable retrieves?
by perrin (Chancellor) on Oct 02, 2001 at 18:46 UTC
    That stuff in the HTML::Template docs is only referring to the cache used for the compiled templates. That cache is not available through a public interface in HTML::Template. However, there's no shortage of good caching modules on CPAN.