diff --git a/src/Entity/Storage/GroupRoleStorage.php b/src/Entity/Storage/GroupRoleStorage.php
index 4bd9cbc..5ff44fd 100644
--- a/src/Entity/Storage/GroupRoleStorage.php
+++ b/src/Entity/Storage/GroupRoleStorage.php
@@ -22,15 +22,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 class GroupRoleStorage extends ConfigEntityStorage implements GroupRoleStorageInterface {
 
   /**
-   * Static cache of a user's group role IDs.
-   *
-   * @todo Perhaps we need to be able to clear this cache during runtime?
-   *
-   * @var array
-   */
-  protected $userGroupRoleIds = [];
-
-  /**
    * The group role synchronizer service.
    *
    * @var \Drupal\group\GroupRoleSynchronizerInterface
@@ -87,7 +78,9 @@ class GroupRoleStorage extends ConfigEntityStorage implements GroupRoleStorageIn
     $uid = $account->id();
     $gid = $group->id();
 
-    if (!isset($this->userGroupRoleIds[$uid][$gid])) {
+    $user_group_role_ids = &drupal_static(__METHOD__);
+
+    if (!isset($user_group_role_ids[$uid][$gid][$include_implied])) {
       $ids = [];
 
       // Get the IDs from the 'group_roles' field, without loading the roles.
@@ -115,10 +108,10 @@ class GroupRoleStorage extends ConfigEntityStorage implements GroupRoleStorageIn
         }
       }
 
-      $this->userGroupRoleIds[$uid][$gid] = $ids;
+      $user_group_role_ids[$uid][$gid][$include_implied] = $ids;
     }
 
-    return $this->loadMultiple($this->userGroupRoleIds[$uid][$gid]);
+    return $this->loadMultiple($user_group_role_ids[$uid][$gid][$include_implied]);
   }
 
 }
diff --git a/tests/src/Kernel/GroupRoleStorageTest.php b/tests/src/Kernel/GroupRoleStorageTest.php
new file mode 100644
index 0000000..5474dea
--- /dev/null
+++ b/tests/src/Kernel/GroupRoleStorageTest.php
@@ -0,0 +1,99 @@
+<?php
+
+namespace Drupal\Tests\group\Kernel;
+
+/**
+ * Tests the behavior of group role storage handler.
+ *
+ * @coversDefaultClass \Drupal\group\Entity\Storage\GroupRoleStorage
+ * @group group
+ */
+class GroupRoleStorageTest extends GroupKernelTestBase {
+
+  /**
+   * The group role storage handler.
+   *
+   * @var \Drupal\group\Entity\Storage\GroupRoleStorageInterface
+   */
+  protected $storage;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->storage = $this->entityTypeManager->getStorage('group_role');
+  }
+
+  /**
+   * Tests the static caching when loading group roles by user/group.
+   *
+   * @covers ::loadByUserAndGroup
+   */
+  public function testLoadByUserAndGroupStaticCache() {
+    $accountA = $this->createUser();
+    $accountB = $this->createUser();
+    $groupA = $this->createGroup();
+    $groupB = $this->createGroup();
+
+    $this->storage->create([
+      'id' => 'roleA',
+      'label' => 'Role A',
+      'group_type' => 'default',
+    ])->save();
+    $this->storage->create([
+      'id' => 'roleB',
+      'label' => 'Role B',
+      'group_type' => 'default',
+    ])->save();
+    $this->storage->create([
+      'id' => 'roleC',
+      'label' => 'Role C',
+      'group_type' => 'default',
+    ])->save();
+
+    // Add the appropriate memberships & roles.
+    $groupA->addMember($accountA, ['group_roles' => ['roleA']]);
+    $groupB->addMember($accountB, ['group_roles' => ['roleB']]);
+    $groupB->addMember($accountA, ['group_roles' => ['roleC']]);
+
+
+    // Loading with internal roles.
+    $roles = $this->storage->loadByUserAndGroup($accountA, $groupA, TRUE);
+    $this->assertCount(2, $roles, 'The internal roles are included, when asked for.');
+    $this->assertArrayHasKey('roleA', $roles);
+    $this->assertArrayHasKey('default-member', $roles);
+
+    // Loading same user, but without internal roles.
+    $roles = $this->storage->loadByUserAndGroup($accountA, $groupA, FALSE);
+    $this->assertCount(1, $roles, 'When you ask for no internal roles, that is what you get.');
+    $this->assertArrayHasKey('roleA', $roles);
+
+    // Loading same user, but different group.
+    $roles = $this->storage->loadByUserAndGroup($accountA, $groupB, FALSE);
+    $this->assertCount(1, $roles, 'When the same user is used with a different group, the correct roles are returned.');
+    $this->assertArrayHasKey('roleC', $roles);
+
+    // Loading same group, but different user.
+    $roles = $this->storage->loadByUserAndGroup($accountB, $groupB, FALSE);
+    $this->assertCount(1, $roles, 'When the same group is used with a different user, the correct roles are returned.');
+    $this->assertArrayHasKey('roleB', $roles);
+
+    // And one more switch of the internal role flag, for kicks.
+    $roles = $this->storage->loadByUserAndGroup($accountA, $groupA, TRUE);
+    $this->assertCount(2, $roles, 'When a given user/group/internal role flag combination is used again after a bunch of other stuff, the correct roles are still returned.');
+    $this->assertArrayHasKey('roleA', $roles);
+    $this->assertArrayHasKey('default-member', $roles);
+
+    // Change user roles around and try again.
+    $groupA->getMember($accountA)->getGroupContent()
+      ->set('group_roles', ['roleB', 'roleC'])->save();
+    drupal_static_reset('Drupal\group\Entity\Storage\GroupRoleStorage::loadByUserAndGroup');
+    $roles = $this->storage->loadByUserAndGroup($accountA, $groupA, TRUE);
+    $this->assertArrayHasKey('roleB', $roles);
+    $this->assertArrayHasKey('roleC', $roles);
+    $this->assertArrayNotHasKey('roleA', $roles);
+  }
+
+}
