Set current default cache class
489786
private function bootCacher()
    {
        /** @var Cacher $cacher */
        $cacher = Cacher::getInstance();

        // Default cacher if FileCache, so we do not check it
        if (MemcachedCache::itWorks()) { // Distributed cache new version
            $cacher->setDefaultCacher('MemcachedCache');
        } elseif (MemcacheCache::itWorks()) { // Distributed cache old version
            $cacher->setDefaultCacher('MemcacheCache');
        } elseif (RedisCache::itWorks()) { // No-sql database
            $cacher->setDefaultCacher('RedisCache');
        }
    }
969796
public function resetDefault()
    {
        if ($record = $this->getSettingsRecord()) {
            $record->delete();
            unset(self::$instances[$this->recordCode]);
            Cache::forget($this->getCacheKey());
        }
    }
1066264
def _load_cache(self):
        """"""
        if not self._disable_cache:
            if os.path.exists(self._cache_path):
                _LOGGER.debug("Cache found at: %s", self._cache_path)
                if os.path.getsize(self._cache_path) > 0:
                    loaded_cache = UTILS.load_cache(self._cache_path)
                    UTILS.update(self._cache, loaded_cache)
                else:
                    _LOGGER.debug("Cache file is empty.  Removing it.")
                    os.remove(self._cache_path)

        self._save_cache()
792940
void overrideCacheFile(File newCacheFile)
  {
    this.cacheFile = newCacheFile;
    this.cacheDir = newCacheFile.getParentFile();
    this.baseCacheFileName = newCacheFile.getName();
  }
487220
def setCachedDataKey(engineVersionHash, key, value):
		
		cacheFile = CachedDataManager._cacheFileForHash(engineVersionHash)
		return JsonDataManager(cacheFile).setKey(key, value)
1264639
private static Class<?> getClassWithCaching(String className,
      Configuration conf) {
    Class<?> classs = cachedClassObjects.get(className);
    if (classs == null) {
      try {
        classs = conf.getClassByName(className);
        if (cachedClassObjects.size() < CACHE_MAX_SIZE) {
          cachedClassObjects.put(className, classs);
        }
      } catch (ClassNotFoundException e) {
        throw new RuntimeException("readObject can't find class " + className,
            e);
      }
    }
    // for sanity check if the class is not null
    if (classs == null) {
      throw new RuntimeException("readObject can't find class " + className);
    }
    return classs;
  }
1247563
def set(self, key, response):
        """"""
        mod = response.headers.pop('last-modified', None)
        status = int(response.status_code)
        rec = (key, status, mod, response.encoding, response.content,
               json.dumps(dict(response.headers)))
        with self._conn:
            self._conn.execute("DELETE FROM cache WHERE key=?", (key, ))
            self._conn.execute("INSERT INTO cache VALUES (?,?,?,?,?,?)", rec)
960434
@Override
	protected void resetCache() {
		super.resetCache();
		cacheProperties.put(JAWR_SERVLET_MAPPING, config.getServletMapping());
		String binaryServletMapping = getBinaryServletMapping();
		if (binaryServletMapping != null) {
			cacheProperties.put(JAWR_BINARY_SERVLET_MAPPING, binaryServletMapping);
		} else {
			cacheProperties.remove(JAWR_BINARY_SERVLET_MAPPING);
		}
		cacheProperties.put(JawrConfig.JAWR_CSS_CLASSPATH_HANDLE_IMAGE,
				Boolean.toString(config.isCssClasspathImageHandledByClasspathCss()));
		cacheProperties.put(JawrConfig.JAWR_BINARY_HASH_ALGORITHM, config.getBinaryHashAlgorithm());
	}
651208
public void
setCache(Cache cache) {
	if (cache == null) {
		this.cache = new Cache(dclass);
		this.temporary_cache = true;
	} else {
		this.cache = cache;
		this.temporary_cache = false;
	}
}
1307292
static <Entry> CacheConfiguration<Long, Entry> getDefaultCacheConfiguration(Class<Entry> entityClass) {
        return getDefaultCacheConfiguration(getCacheName(entityClass));
    }
252195
protected void addCache(Class cls, String pkgname, List<String> classnames, List<Class> classes) {
    m_CacheNames.put(cls.getName() + "-" + pkgname, classnames);
    m_CacheClasses.put(cls.getName() + "-" + pkgname, classes);
  }
637983
def SetCacheMode(mode):
    """"""
    global cache_mode
    if mode == "auto":
        cache_mode = AUTO
    elif mode == "force":
        cache_mode = FORCE
    elif mode == "cache":
        cache_mode = CACHE
    else:
        raise ValueError("SCons.SConf.SetCacheMode: Unknown mode " + mode)
785111
def ultracache(timeout, *params):
    """"""

    def decorator(cls):
        class WrappedClass(cls):
            def __init__(self, *args, **kwargs):
                super(WrappedClass, self).__init__(*args, **kwargs)

            @cached_get(timeout, *params)
            def get(self, *args, **kwargs):
                return super(WrappedClass, self).get(*args, **kwargs)

        return WrappedClass
    return decorator
658387
def enable_cache():
    """"""
    try:
        import requests_cache
    except ImportError as err:
        sys.stderr.write('Failed to enable cache: {0}\n'.format(str(err)))
        return
    if not os.path.exists(CACHE_DIR):
        os.makedirs(CACHE_DIR)
    requests_cache.install_cache(CACHE_FILE)
1363189
function setCache($cache,$expire=3600)
	{
		$this->cache = $cache;
		$this->if_cache = true;
		$this->expire = $expire;
	}
1263471
def cache(self, name='cache', default_timeout=3600):
        
        return Cache(self, name=name, default_timeout=default_timeout)
199966
public function setCacheDefaultChmod($cacheDefaultChmod)
    {
        $this->cacheDefaultChmod = $cacheDefaultChmod;
        $this->debug->debug(__FUNCTION__, 'setCacheDefaultChmod: ', $this->cacheDefaultChmod);
    }