http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7248
--- Comment #40 from Paul Poulain <[email protected]> --- Created attachment 9554 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9554&action=edit Bug 7248/7249 follow-up: more generic cache handling This patch update the cache handling to Koha::Cache. So, whatever the cache mechanism is, Koha caching will work this way: use Koha::Cache; my $cache = Koha::Cache->new(); if ($cache) { $cache->get_from_cache($identifier) } if ($cache) { $cache->set_in_cache( $identifier, $value, $cache_expiry ); } Test plan: * setup a Koha with MEMCACHE activated (MEMCACHED_NAMESPACE is defined in koha-httpd.conf) * setup Koha with DEBUG on (SetEnv DEBUG "1" in koha-httpd.conf) * restart Apache * load a report $KOHA/cgi-bin/koha/svc/report?id=<ID> In the Apache logs you will get: * report: We have and will use a cache at /home/paul/koha.dev/koha-community/opac/svc/report line 40. => confirmation we will use memcache * execute_query(<A QUERY>) => the cache is still empty, we run the SQL load the report again, you'll get: * report: We have and will use a cache at /home/paul/koha.dev/koha-community/opac/svc/report line 40. => confirmation we will use memcache * report: Report <ID> retrieved from cache at /home/paul/koha.dev/koha-community/opac/svc/report line 43. => confirmation we are retrieving the result from the cache Remove the MEMCACHE env variable, restart Apache, reload the page, you'll get: * report: No caching system at /home/paul/koha.dev/koha-community/Koha/Cache.pm line 75. => confirmation you have no caching system active -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
