in reply to Web app frameworks - I am totally confused!

Hi...I have a related question...

I deal with many cgi scripts that must perform time consuming processes, I'm looking for a framework or module that handle cleanly what I'm cobbling together manually.

To prevent timeouts, currently I write a CGI::Session id, fork a child, send the browser a session cookie and page with a meta refresh on it. The browser refreshes, sending the id, until the child query is done.

Second I also use Memoize to store responses to certain time consuming sql queries, and a few subroutine calls.

I can only cache for about an hour to keep things fresh however. So I have to do a fair amount of work to accomplish that (normalize functions, and deleting stale data), I also had to modify the source to use the locking version of storable calls so multiple processes can use the cache file.

Third I make extensive use of expires and cache-control headers etc, but often requests are different enough that the script still has to be hit.

Basically I just want to have a framework that handles the above, without having to roll so much of my own.

any suggestions? thanks

  • Comment on framework to handle timeouts/internal caching?

Replies are listed 'Best First'.
Re: framework to handle timeouts/internal caching?
by fglock (Vicar) on Oct 04, 2004 at 21:01 UTC

    I can only cache for about an hour to keep things fresh however. So I have to do a fair amount of work to accomplish that ...

    Cache::Cache can help you here.

    my $cache = new Cache::FileCache( ); my $result = $cache->get( "result" ); if ( not defined $result { $result = expensive_function(); $cache->set( "result", $result, "1 hour" ); }