@@ -, +, @@ --- Koha/Cache.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/Koha/Cache.pm +++ a/Koha/Cache.pm @@ -49,12 +49,15 @@ use Carp; use base qw(Class::Accessor); +use vars qw($_cache_handler); + use Koha::Cache::Memcached; __PACKAGE__->mk_ro_accessors( qw( cache ) ); sub new { my $class = shift; + return $_cache_handler if $_cache_handler; # my $param = shift; my $cache; my $subclass; @@ -69,7 +72,8 @@ sub new { } ) or croak "Cannot create cache handle for memcache"; - return bless $class->SUPER::new({cache => $cache}), $subclass; + $_cache_handler = bless $class->SUPER::new({cache => $cache}), $subclass; + return $_cache_handler; } else { $ENV{DEBUG} && warn "No caching system"; return; --