[Koha-bugs] [Bug 7248] Caching for services
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon May 14 10:20:50 CEST 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7248
--- Comment #35 from Paul Poulain <paul.poulain at biblibre.com> ---
Looking at how this caching works in bug 7249, I think this part of the code is
wrong:
+if ($usecache) {
+ require Koha::Cache;
+ Koha::Cache->import();
+ $cache = Koha::Cache->new(
+ {
+ 'cache_type' => 'memcached',
+ 'cache_servers' => $ENV{'MEMCACHED_SERVERS'}
+ }
+ );
+ my $namespace = $ENV{'MEMCACHED_NAMESPACE'} || 'koha';
+ my $page = $cache->get_from_cache("$namespace:intranet:report:$report");
+ if ($page) {
+ print $query->header;
+ print $page;
+ exit;
+ }
+}
=> 'memcached' is hardcoded in the file that use caching, the caching mechanism
must be generic.
The caching API must be something like:
use Koha::Cache;
my $cache_server = Koha::Cache->new();
if $cache_server( my $page =
$cache->get_from_cache("intranet:report:$report");)
so it won't depend on the caching system & caching configuration.
I'll provide a patch for that ASAP (maybe today)
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list