Return True if there is a cached current state for this app
518667
def have_current_state_entry(self, wid, key):
        ''
        cscoll = self.current_state()
        c_state = cscoll.get(wid, {})
        return key in c_state
600403
def isModified(self):
        
        # NOTE: only check content digest if locally cached content is set
        # (content already pulled or new content set); otherwise this
        # results in pulling content down to checksum it !
        return self.info_modified or \
            self._content and self._content_digest() != self.digest
23129
def isInCache(self):
    
    url = self.buildUrl(cache_friendly=True)
    return url in __class__.cache
387720
function() {
            if (!this.available) return;

            if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
                this.trigger("update");
            }
            return window.applicationCache.status === window.applicationCache.UPDATEREADY;
        }
1336012
def _get_cache(self):
        
        if not self._cache:
            self._cache = get_cache(self.app)
        return self._cache
768963
public function cacheExists()
    {
        $cacheFile = $this->getCacheFile();
        if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {
            return(true);
        } else {
            return(false);
        }
    }
809295
function checkCache() {
// Check if new appcache is available, load it, and reload page.
//if (window.applicationCache) {
//  window.applicationCache.addEventListener('updateready', function(e) {
//    if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
//      window.applicationCache.swapCache();
//      if (confirm('A new version of this site is available. Load it?')) {
//        window.location.reload();
//      }
//    }
//  }, false);
//}

	if(cache) {

		cacheStatusValues[0] = 'uncached';
		cacheStatusValues[1] = 'idle';
		cacheStatusValues[2] = 'checking';
		cacheStatusValues[3] = 'downloading';
		cacheStatusValues[4] = 'updateready';
		cacheStatusValues[5] = 'obsolete';

		cache.addEventListener('cached', logEvent, false);
		cache.addEventListener('checking', logEvent, false);
		cache.addEventListener('downloading', logEvent, false);
		cache.addEventListener('error', logEvent, false);
		cache.addEventListener('noupdate', logEvent, false);
		cache.addEventListener('obsolete', logEvent, false);
		cache.addEventListener('progress', logEvent, false);
		cache.addEventListener('updateready', logEvent, false);
	}

}
1305645
def is_connected(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        return int(device_json.get("dpConnectionStatus")) > 0
588256
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
	{
		if (!$this->caching)
		return false;

		if (!isset($compile_id))
		$compile_id = $this->compile_id;

		$_params = array(
            'tpl_file' => $tpl_file,
            'cache_id' => $cache_id,
            'compile_id' => $compile_id
		);
		require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
		return smarty_core_read_cache_file($_params, $this);
	}
234279
@Override
  public boolean isModified()
  {
    long now = CurrentTime.currentTime();
    long lastCheckTime = _lastCheckTime.get();
    
    if (now <= lastCheckTime + _checkInterval) {
      return _isModified;
    }

    if (! _lastCheckTime.compareAndSet(lastCheckTime, now)) {
      return _isModified;
    }

    if (isModifiedImpl()) {
      _isModified = true;
      //_lastCheckTime.set(0);
    }
    else {
      _isModified = false;
    }

    return _isModified;
  }
987415
public function isCached() {
    $cache = ObjectFactory::getInstance('staticCache');
    return $this->id == self::NO_CACHE ? false :
            $cache->exists(self::getCacheSection($this->type), self::getCacheId($this->id));
  }
507372
def was_modified_since_last_sync(self):
        
        info = self.get_sync_info()
        if not info:
            return None
        if self.size != info["s"]:
            return True
        if self.mtime > info["m"]:
            return True
        return False
1149467
public boolean hasCache() {
        if (isCache()) {
            return true;
        }
        if (CommonUtils.isNotEmpty(methods)) {
            for (MethodConfig methodConfig : methods.values()) {
                if (CommonUtils.isTrue(methodConfig.getCache())) {
                    return true;
                }
            }
        }
        return false;
    }
320973
def evaluate_cached(self, **kwargs):
        """"""
        if not hasattr(self, 'result'):
            self.result = self.evaluate(cache=True, **kwargs)

        return self.result
976375
def check_cache(self, e_tag, match):
        """"""
        if e_tag != match:
            return False
        self.send_response(304)
        self.send_header("ETag", e_tag)
        self.send_header("Cache-Control",
                         "max-age={0}".format(self.server.max_age))
        self.end_headers()
        thread_local.size = 0
        return True
1105832
private Boolean switchCheckAndAbortLocked() {
    if (!hasExpansionOccurred()) {
      clearOutReferences();
      return true;
    }
    hashArray = hash.getEntries();
    clearCount = hash.getClearOrCloseCount();
    boolean _cacheClosed = hashArray == null;
    if (_cacheClosed) {
      clearOutReferences();
      throw new CacheClosedException(cache);
    }
    return false;
  }
402652
def cached_unless_authenticated(timeout=50, key_prefix='default'):
    """"""
    def caching(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            cache_fun = current_cache.cached(
                timeout=timeout, key_prefix=key_prefix,
                unless=lambda: current_cache_ext.is_authenticated_callback())
            return cache_fun(f)(*args, **kwargs)
        return wrapper
    return caching