- Added cache to settings which increased performance by .02 seconds per

page.
 - Added user cache which increased performance by more than .1 seconds per
   page.
 - Added some new indicies to make asset queries .01 to .1 seconds faster per query.
 - fix [ 1274488 ] Visitors language not recognized 6.7.2
This commit is contained in:
JT Smith 2005-09-10 15:37:03 +00:00
parent 1ca2a2718b
commit 62d1c58ae4
11 changed files with 230 additions and 89 deletions

View file

@ -97,7 +97,7 @@ Retrieve content from the filesystem cache.
sub get {
my $self = shift;
return undef if ($session{config}{disableCache});
return undef if ($WebGUI::Session::session{config}{disableCache});
if (open(FILE,"<".$self->getFolder()."/expires")) {
my $expires = <FILE>;
close(FILE);
@ -136,10 +136,10 @@ Figures out what the cache root for this namespace should be. A class method.
sub getNamespaceRoot {
my $self = shift;
my $root = $session{config}{fileCacheRoot};
my $root = $WebGUI::Session::session{config}{fileCacheRoot};
unless ($root) {
if ($session{os}{windowsish}) {
$root = $session{env}{TEMP} || $session{env}{TMP} || "/temp";
if ($WebGUI::Session::session{os}{windowsish}) {
$root = $WebGUI::Session::session{env}{TEMP} || $WebGUI::Session::session{env}{TMP} || "/temp";
} else {
$root = "/tmp";
}
@ -205,7 +205,7 @@ sub new {
my $cache;
my $class = shift;
my $key = $class->parseKey(shift);
my $namespace = shift || $session{config}{configFile};
my $namespace = shift || $WebGUI::Session::session{config}{configFile};
bless {_key=>$key, _namespace=>$namespace}, $class;
}

View file

@ -89,7 +89,7 @@ Retrieve content from the filesystem cache.
=cut
sub get {
return undef if ($session{config}{disableCache});
return undef if ($WebGUI::Session::session{config}{disableCache});
return $_[0]->{_cache}->get($_[0]->{_key});
}
@ -113,14 +113,14 @@ sub new {
my $cache;
my $class = shift;
my $key = $class->parseKey(shift);
my $namespace = shift || $session{config}{configFile};
my $namespace = shift || $WebGUI::Session::session{config}{configFile};
# Overcome maximum key length of 255 characters
if(length($key.$namespace) > 255) {
$key = Digest::MD5::md5_base64($key);
}
my $servers = $session{config}{memcached_servers};
my $servers = $WebGUI::Session::session{config}{memcached_servers};
$servers = [ $servers ] unless (ref $servers);
my %options = (