Data coming from entityTypeManager->getStorage is cached data? I am working on one Drupal 8.3 site. I created my own custom Authentication provider for REST API authorisation.

Following are the "authenticate" method sample code.

/**
   * {@inheritdoc}
   */
  public function authenticate(Request $request) {
      try {

          $uid = 1;// passing 1 for testing.

          $accounts = $this-&gt;entityTypeManager-&gt;getStorage('user')-&gt;loadByProperties(array('uid' =&gt; $uid, 'status' =&gt; 1));
          $account = reset($accounts);
          if ($account) {
              return $this-&gt;entityTypeManager-&gt;getStorage('user')-&gt;load($uid);
          }
      } 
      return [];
  }


My doubt here is "$this->entityTypeManager->getStorage" is getting data from cache table. Or everytime it connect to db and generate response?
load() and loadMultiple() are cached, loadByProperties() is a shortcut for an entity query + load, the entity query is not cached.

Do not use loadByProperties() if you know the entity ID.