diff --git a/module/VuFind/src/VuFind/Content/ObalkyKnihService.php b/module/VuFind/src/VuFind/Content/ObalkyKnihService.php
index af1de003cdaa91ae22809f07dc53648df3ecfd51..1d44e97852642dca93ad0b208d0bd2d0f983317b 100644
--- a/module/VuFind/src/VuFind/Content/ObalkyKnihService.php
+++ b/module/VuFind/src/VuFind/Content/ObalkyKnihService.php
@@ -106,15 +106,11 @@ class ObalkyKnihService implements \VuFindHttp\HttpServiceAwareInterface,
      */
     protected function createCacheKey(array $ids)
     {
-        array_walk(
-            $ids, function (&$value, $key) {
-                if (gettype($value) === 'object') {
-                    $value = $value->get13();
-                }
-                $value = "$key::$value";
-            }
-        );
-        return implode("%%", $ids);
+        $key = $ids['recordid'];
+        $key = !empty($key) ? $key
+            : (isset($ids['isbn']) ? $ids['isbn']->get13() : null);
+        $key = !empty($key) ? $key : sha1(json_encode($ids));
+        return $key;
     }
 
     /**