diff --git a/modules/ggroup/ggroup.module b/modules/ggroup/ggroup.module
--- a/modules/ggroup/ggroup.module
+++ b/modules/ggroup/ggroup.module
@@ -43,7 +43,9 @@ function ggroup_group_content_insert(GroupContentInterface $group_content) {
   \Drupal::service('ggroup.group_hierarchy_manager')->addSubgroup($group_content);

   // Rebuild role inheritance cache.
-  \Drupal::service('ggroup.group_role_inheritance')->rebuild();
+  $group_id = $group_content->getGroup()->id();
+  \Drupal::service('ggroup.group_role_inheritance')->rebuild($group_id);
+
 }

 /**
@@ -60,5 +62,6 @@ function ggroup_group_content_delete(GroupContentInterface $group_content) {
   \Drupal::service('ggroup.group_hierarchy_manager')->removeSubgroup($group_content);

   // Remove role inheritance cache.
-  \Drupal::service('ggroup.group_role_inheritance')->rebuild();
+  $group_id = $group_content->getGroup()->id();
+  \Drupal::service('ggroup.group_role_inheritance')->rebuild($group_id);
 }
diff --git a/modules/ggroup/src/Graph/GroupGraphStorageInterface.php b/modules/ggroup/src/Graph/GroupGraphStorageInterface.php
--- a/modules/ggroup/src/Graph/GroupGraphStorageInterface.php
+++ b/modules/ggroup/src/Graph/GroupGraphStorageInterface.php
@@ -14,7 +14,7 @@ interface GroupGraphStorageInterface {
    *   An array containing all relations between groups with the parent group as
    *   key and the child group as value.
    */
-  public function getGraph();
+  public function getGraph($group_id);

   /**
    * Relates the parent group and the child group.
diff --git a/modules/ggroup/src/Graph/SqlGroupGraphStorage.php b/modules/ggroup/src/Graph/SqlGroupGraphStorage.php
--- a/modules/ggroup/src/Graph/SqlGroupGraphStorage.php
+++ b/modules/ggroup/src/Graph/SqlGroupGraphStorage.php
@@ -77,11 +77,18 @@ protected function invalidate($gids) {
     if (!empty($gids)) {
       // Create a cache tag for all the groups passed in.
       foreach ($gids as $gid) {
-        $cache_tags[] = 'group:' . $group;
+        $cache_tags[] = 'group:' . $gid;

         // @TODO: Should the cache be actively rebuilt instead?
         // Indicate that this group needs to be reloaded.
         $this->loaded[$gid] = FALSE;
+
+        // Remove all the values for this group since the values are no longer
+        // considered valid.
+        unset($this->ancestors[$gid]);
+        unset($this->decendants[$gid]);
+        unset($this->directAncestors[$gid]);
+        unset($this->directDescendants[$gid]);
       }

       // And invalidate the tags.
@@ -322,11 +329,19 @@ protected function insertEdgesParentIncomingToChildOutgoing($edge_id, $parent_gr
   /**
    * {@inheritdoc}
    */
-  public function getGraph() {
+  public function getGraph($group_id) {
     $query = $this->connection->select('group_graph', 'gg')
       ->fields('gg', ['start_vertex', 'end_vertex'])
       ->orderBy('hops')
       ->orderBy('start_vertex');
+
+     // This Or Group is identical to the one used in the query below.
+    $or_group = $query->orConditionGroup();
+    $or_group->condition('gg.start_vertex', $group_id)
+      ->condition('gg.end_vertex', $group_id);
+
+    // Add the Or Group
+    $query->condition($or_group);
     return $query->execute()->fetchAll();
   }

@@ -495,7 +510,6 @@ public function getPath($parent_group_id, $child_group_id) {
     if (!$this->isAncestor($parent_group_id, $child_group_id)) {
       return [];
     }
-
     $visited = [];
     $solutions = [];

diff --git a/modules/ggroup/src/GroupHierarchyManager.php b/modules/ggroup/src/GroupHierarchyManager.php
--- a/modules/ggroup/src/GroupHierarchyManager.php
+++ b/modules/ggroup/src/GroupHierarchyManager.php
@@ -183,7 +183,7 @@ public function getInheritedGroupRoleIdsByUser(GroupInterface $group, AccountInt
       $this->userMemberships[$account_id] = $this->membershipLoader->loadByUser($account);
     }

-    $role_map = $this->groupRoleInheritanceManager->getAllInheritedGroupRoleIds();
+    $role_map = $this->groupRoleInheritanceManager->getAllInheritedGroupRoleIds($group_id);

     $mapped_role_ids = [[]];
     foreach ($this->userMemberships[$account_id] as $membership) {
diff --git a/modules/ggroup/src/GroupRoleInheritance.php b/modules/ggroup/src/GroupRoleInheritance.php
--- a/modules/ggroup/src/GroupRoleInheritance.php
+++ b/modules/ggroup/src/GroupRoleInheritance.php
@@ -2,6 +2,7 @@

 namespace Drupal\ggroup;

+use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\ggroup\Graph\GroupGraphStorageInterface;
@@ -74,30 +75,32 @@ public function __construct(GroupGraphStorageInterface $group_graph_storage, Ent
   /**
    * {@inheritdoc}
    */
-  public function getAllInheritedGroupRoleIds() {
-    if (!empty($this->roleMap)) {
+  public function getAllInheritedGroupRoleIds($group_id) {
+    if (!empty($this->roleMap[$group_id])) {
       return $this->roleMap;
     }
+    $cid = GroupRoleInheritanceInterface::ROLE_MAP_CID . ':' . $group_id;

-    $cache = $this->cache->get(GroupRoleInheritanceInterface::ROLE_MAP_CID);
+    $cache = $this->cache->get($cid);
     if ($cache && $cache->valid) {
-      $this->roleMap = $cache->data;
+      $this->roleMap[$group_id] = $cache->data;
       return $this->roleMap;
     }

-    $this->roleMap = $this->build();
-    $this->cache->set(GroupRoleInheritanceInterface::ROLE_MAP_CID, $this->roleMap);
+    $this->roleMap[$group_id] = $this->build($group_id);
+    $this->cache->set($cid, $this->roleMap[$group_id], Cache::PERMANENT, ['group:' . $group_id]);

-    return $this->build();
+    return $this->build($group_id);
   }

   /**
    * {@inheritdoc}
    */
-  public function rebuild() {
-    $this->cache->delete(GroupRoleInheritanceInterface::ROLE_MAP_CID);
-    $this->roleMap = $this->build();
-    $this->cache->set(GroupRoleInheritanceInterface::ROLE_MAP_CID, $this->roleMap);
+  public function rebuild($group_id) {
+    $cid = GroupRoleInheritanceInterface::ROLE_MAP_CID . ':' . $group_id;
+    $this->cache->delete($cid);
+    $this->roleMap[$group_id] = $this->build($group_id);
+    $this->cache->set($cid, $this->roleMap[$group_id], Cache::PERMANENT, ['group:' . $group_id]);
   }

   /**
@@ -108,9 +111,10 @@ public function rebuild() {
    *   relations. The array is in the form of:
    *   $map[$group_a_id][$group_b_id][$group_b_role_id] = $group_a_role_id;
    */
-  protected function build() {
+  protected function build($gid) {
     $role_map = [];
-    $group_relations = array_reverse($this->groupGraphStorage->getGraph());
+    $group_relations = array_reverse($this->groupGraphStorage->getGraph($gid));
+
     foreach ($group_relations as $group_relation) {
       $group_id = $group_relation->start_vertex;
       $subgroup_id = $group_relation->end_vertex;
@@ -136,7 +140,6 @@ protected function build() {
           // Get mapped roles for relation type. Filter array to remove
           // unmapped roles.
           $relation_config = $this->getSubgroupRelationConfig($path_supergroup_id, $path_subgroup_id);
-
           $path_role_map[$path_supergroup_id][$path_subgroup_id] = array_filter($relation_config['child_role_mapping']);
           $path_role_map[$path_subgroup_id][$path_supergroup_id] = array_filter($relation_config['parent_role_mapping']);
         }
@@ -150,7 +153,7 @@ protected function build() {
       }
     }

-    return array_replace_recursive(...$role_map);
+    return !empty($role_map) ? array_replace_recursive(...$role_map) : [];
   }

   /**
diff --git a/modules/ggroup/src/GroupRoleInheritanceInterface.php b/modules/ggroup/src/GroupRoleInheritanceInterface.php
--- a/modules/ggroup/src/GroupRoleInheritanceInterface.php
+++ b/modules/ggroup/src/GroupRoleInheritanceInterface.php
@@ -25,11 +25,11 @@ interface GroupRoleInheritanceInterface {
    *   relations. The array is in the form of:
    *   $map[$group_a_id][$group_b_id][$group_b_role_id] = $group_a_role_id;
    */
-  public function getAllInheritedGroupRoleIds();
+  public function getAllInheritedGroupRoleIds($group_id);

   /**
    * Rebuild the nested array with all inherited roles for all group relations.
    */
-  public function rebuild();
+  public function rebuild($group_id);

 }
