From 7df9800672f329fdb2ed23253368bdaf48a9008e Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 25 Aug 2009 16:46:18 +1200 Subject: [PATCH] Adding some caching to C4::Biblio, to GetMarcStructure Signed-off-by: Galen Charlton --- C4/Biblio.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 569e09e4b8..04d404cccc 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -114,6 +114,19 @@ BEGIN { ); } +eval { + my $servers = C4::Context->config('memcached_servers'); + if ($servers) { + require Memoize::Memcached; + import Memoize::Memcached qw(memoize_memcached); + + my $memcached = { + servers => [ $servers ], + key_prefix => C4::Context->config('memcached_namespace') || 'koha', + }; + memoize_memcached('GetMarcStructure', memcached => $memcached, expire_time => 600); #cache for 10 minutes + } +}; =head1 NAME C4::Biblio - cataloging management functions -- 2.39.5