Jonathan's right, the overhead of caching data shared between apache
processes is probably more than a DB call using a cached DBI handle.
For multi page forms I just keep it all in hidden form fields between
pages, validating as we go, then revalidate all the fields before
finally comitting to the DB.
Jonathan Vanasco wrote:
what exactly do you want to cache?
the form inputs or the forms?
if its the forms themselves, you could cache in mod_perl before the
fork, or use somthing like memcached
otherwise , you're best off with a db
you can't use modperl, because caching will be per-child -- you
might put something in the request on FormA, then on FormB be served
by a different child , who has a different memory pool (is that the
right term) than the other child
you can't use memcached or one of the other memory based cache
services, because they're not backup safe. if the process dies or
whatever, then you lose the entire cache
On Feb 4, 2006, at 12:25 AM, RJ Herrick wrote:
Hi all,
I'm starting to do a lot of form processing, and came across the
idea of caching table metadata while validating to avoid unnecessary
DB (MySQL) calls. I just realized that, with mod_perl, I could even
do this across requests- and since the data shouldn't be changing,
this seems like a good way to trade some memory for a boost in speed.
I'm still very much on the learning curve with mod_perl and wanted
to see if anyone out there was already doing this, and if so, any
suggestions / comments / advise they might have.
Thank you all in advance,
RJ Herrick
--
"A foolish consistency is the hobgoblin of little minds" -Ralph
Waldo Emerson