-if (Koha::Cache->is_cache_active) {
- if ($report_name) { # When retrieving by name, we have to hit the
- # database to get the ID before we can check
- # the cache. Yuck.
- ( $sql, $type, $report_name, $notes, $cache_expiry, $public, $report_id ) =
- get_saved_report( { 'name' => $report_name } );
- }
-
+my $cache_active = Koha::Cache->is_cache_active;
+my ($cache_key, $cache, $json_text);
+if ($cache_active) {
+ $cache_key = "intranet:report:".($report_name ? "name:$report_name" : "id:$report_id");