protected function loadMessages($category, $language)
    {
        if ($this->enableCaching) {
            $cacheKey = [
                __CLASS__,
                $category,
                $language,
            ];
            return $this->cache
                ->get($cacheKey)
                ->then(function($data) {
                    return $data !== null ? $data : Reaction\Promise\reject(null);
                })->otherwise(function() use ($category, $language, $cacheKey) {
                    $messages = [];
                    return $this->loadMessagesFromDb($category, $language)
                        ->then(function($messagesDb) use (&$messages, $cacheKey) {
                            $messages = $messagesDb;
                            return $this->cache->set($cacheKey, $messagesDb, $this->cachingDuration);
                        })->then(function() use (&$messages) {
                            return $messages;
                        });
                });
        }

        return $this->loadMessagesFromDb($category, $language);
    }