code: function checkCacheStatus(src) {
        var defer = $q.defer();
  
        _checkImgCacheReady()
          .then(function() {
            ImgCache.isCached(src, function(path, success) {
              if (success) {
                defer.resolve(path);
              } else {
                ImgCache.cacheFile(src, function() {
                  ImgCache.isCached(src, function(path, success) {
                    defer.resolve(path);
                  }, defer.reject);
                }, defer.reject);
              }
            }, defer.reject);
          })
          .catch(defer.reject);
  
        return defer.promise;
      }
docs: Checks file cache status by url.
  @param {string} src - image source url.