[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] Load Testing cgiapp


> The question stands though - is there a way to "cache" the query 
> information for all users?  Example: the app can be called from 
> 3 different domains, and using the domain information, load 3 
> different sets of information and store them for every request 
> (changes every 15 minutes).  Does anything do this?  It's built 
> in to some application servers (like ColdFusion - which has lots 
> of faults, but does cache data in memory for all users very well).

Well, you could use one of the Cached::* modules and do something like
(untested):

sub complex_query {
    my $self = shift;
    my @args = @_;
    my $key = 'complex_query:' . join(',' @args);

    my $cache = new Cache::FileCache( );
    my $rs    = $cache->get($key);
    return $rs if defined($rs);
	
    my $statement = 'select ....';
    $rs = $self->dbh->selectall_arrayref($statement, \%attr, @args);
    $cache->set($key, $rs, "10 minutes");
    return $rs;
}

HTH

Dan



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.