docs: def is_cached(self, path, saltenv='base', cachedir=None):
          '''
          Returns the full path to a file if it is cached locally on the minion
          otherwise returns a blank string
          '''
          if path.startswith('salt://'):
              path, senv = salt.utils.url.parse(path)
              if senv:
                  saltenv = senv
  
          escaped = True if salt.utils.url.is_escaped(path) else False
  
          # also strip escape character '|'
          localsfilesdest = os.path.join(
              self.opts['cachedir'], 'localfiles', path.lstrip('|/'))
          filesdest = os.path.join(
              self.opts['cachedir'], 'files', saltenv, path.lstrip('|/'))
          extrndest = self._extrn_path(path, saltenv, cachedir=cachedir)
  
          if os.path.exists(filesdest):
              return salt.utils.url.escape(filesdest) if escaped else filesdest
          elif os.path.exists(localsfilesdest):
              return salt.utils.url.escape(localsfilesdest) \
                  if escaped \
                  else localsfilesdest
          elif os.path.exists(extrndest):
              return extrndest
  
          return ''