Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of LTjake (4001)

Wednesday September 03, 2003
07:44 AM

GEDCOM update

[ #14460 ]

I've moved red13 to a faster box.

I also took the time to add some caching to the gedcom app. I had a slight problem figuring out how i should track how fresh file are in the cache. I decided that a solution could be to append at timestamp to the end of the cache key.

My cache keys now look like: 'pagename::timestamp'. Unfortunately, i now have to grep() through the keys to find one that matches, rather than just calling $cache->get() right away.

Having just said that, i think it might be easier to use the gedcom file's timestamp to check the cache -- sort of like a version number. That way i can write $cache->get( $page . '::' . $ts ) right away and if undef is returned, a new file must be generated.

An ugly hack that i'd like to get rid off is how i handle cached and uncached data.

I stop the flow of the CGI::Application in cgiapp_prerun(). This sub will either use cached data, or grab the output of the appropriate runmode then stuff it into a CGI::App parameter. No matter which runmode was called it will always end up going to a "show_output" mode which simply return the value of said CGI::App parameter. Ah well, it works.

Download the code, if you want. I'll be making more changes soon.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.