Purges the cache if one of the url providers tells us to.
163669
private function purgeExpiredRoutes()
    {
        $expireTag = '';
        foreach ($this->routeProviders as $routeProvider) {
            /* @var $routeProvider UrlProviderInterface */
            $expireTag .= $routeProvider->getExpirationTag();
        }

        $value = md5($expireTag);

        $urlNodesCacheItem = $this->cachePool->getItem('splashExpireTag');

        if ($urlNodesCacheItem->isHit() && $urlNodesCacheItem->get() === $value) {
            return;
        }

        $this->purgeUrlsCache();

        $urlNodesCacheItem->set($value);
        $this->cachePool->save($urlNodesCacheItem);
    }
1304614
public static void cleanup ()
  {
    // Reinitialize singletons to the default values
    if (LocaleCache.isInstantiated ())
      LocaleCache.getInstance ().reinitialize ();
    if (CountryCache.isInstantiated ())
      CountryCache.getInstance ().reinitialize ();
    if (LanguageCache.isInstantiated ())
      LanguageCache.getInstance ().reinitialize ();
    if (SerializationConverterRegistry.isInstantiated ())
      SerializationConverterRegistry.getInstance ().reinitialize ();
    if (MimeTypeDeterminator.isInstantiated ())
      MimeTypeDeterminator.getInstance ().reinitialize ();
    if (ThirdPartyModuleRegistry.isInstantiated ())
      ThirdPartyModuleRegistry.getInstance ().reinitialize ();
    if (TypeConverterRegistry.isInstantiated ())
      TypeConverterRegistry.getInstance ().reinitialize ();
    if (URLProtocolRegistry.isInstantiated ())
      URLProtocolRegistry.getInstance ().reinitialize ();
    if (EqualsImplementationRegistry.isInstantiated ())
      EqualsImplementationRegistry.getInstance ().reinitialize ();
    if (HashCodeImplementationRegistry.isInstantiated ())
      HashCodeImplementationRegistry.getInstance ().reinitialize ();

    // Clear caches
    if (DefaultTextResolver.isInstantiated ())
      DefaultTextResolver.getInstance ().clearCache ();
    EnumHelper.clearCache ();
    ResourceBundleHelper.clearCache ();
    if (RegExCache.isInstantiated ())
      RegExCache.getInstance ().clearCache ();
    CollatorHelper.clearCache ();
    LocaleHelper.clearCache ();
    StatisticsManager.clearCache ();
    SystemProperties.clearWarnedPropertyNames ();
    if (ImageDataManager.isInstantiated ())
      ImageDataManager.getInstance ().clearCache ();

    // Clean this one last as it is used in equals and hashCode implementations!
    ClassHierarchyCache.clearCache ();
  }
758388
def clear_cache(self):
        """"""
        self.logger.debug("Clearing cache")
        if os.path.isdir(self.songcache_dir):
            for filename in os.listdir(self.songcache_dir):
                file_path = os.path.join(self.songcache_dir, filename)
                try:
                    if os.path.isfile(file_path):
                        os.unlink(file_path)
                except PermissionError:
                    pass
                except Exception as e:
                    logger.exception(e)
        self.logger.debug("Cache cleared")
609579
public void clearCache()
  {
    ZipFile zipFile = _zipFileRef.getAndSet(null);

    if (zipFile != null)
      try {
        zipFile.close();
      } catch (Exception e) {
      }
  }
753526
def cleanup(self):
        '''
        
        '''
        log.debug('ConCache cleaning up')
        if os.path.exists(self.cache_sock):
            os.remove(self.cache_sock)
        if os.path.exists(self.update_sock):
            os.remove(self.update_sock)
        if os.path.exists(self.upd_t_sock):
            os.remove(self.upd_t_sock)
582673
public final void clearCache() {
        if (unusedViews != null) {
            unusedViews.clear();
            unusedViews = null;
        }

        logger.logDebug(getClass(), "Removed all unused views from cache");
    }
1293561
public void onShutdown(){
        CacheRegistry.getInstance().clearDynamicServices();// clear dynamic cache services
        synchronized (allCaches) {
            for (String cacheName : allCaches.keySet()) {
                CacheService cachingObj= allCaches.get(cacheName);
                cachingObj.clearCache();
            }
        }
    }
398121
public function purgeAll() {
		
		if ($this->useFallback) {
			if ($this->log) {
				$this->log->trace("Purging the whole file cache.");
			}
			$files = glob($this->getDirectory()."*");
			foreach ($files as $filename) {
				unlink($filename);
			}
			return;
		}
		
		apc_clear_cache('user');
	}
1208119
function purgeCacheIfNecessary () {
  // If max cache size has not been exceeded, do nothing
  if (cacheSizeInBytes <= maximumSizeInBytes) {
    return;
  }

  // Cache size has been exceeded, create list of images sorted by timeStamp
  // So we can purge the least recently used image
  function compare (a, b) {
    if (a.timeStamp > b.timeStamp) {
      return -1;
    }
    if (a.timeStamp < b.timeStamp) {
      return 1;
    }

    return 0;
  }
  cachedImages.sort(compare);

  // Remove images as necessary)
  while (cacheSizeInBytes > maximumSizeInBytes) {
    const lastCachedImage = cachedImages[cachedImages.length - 1];
    const imageId = lastCachedImage.imageId;

    removeImageLoadObject(imageId);

    triggerEvent(events, EVENTS.IMAGE_CACHE_PROMISE_REMOVED, { imageId });
  }

  const cacheInfo = getCacheInfo();

  triggerEvent(events, EVENTS.IMAGE_CACHE_FULL, cacheInfo);
}
772332
public void purgeCache() {
        synchronized (users) {
            users.values().stream()
                    .map(Reference::get)
                    .filter(Objects::nonNull)
                    .map(Cleanupable.class::cast)
                    .forEach(Cleanupable::cleanup);
            users.clear();
        }
        userIdByRef.clear();
        servers.values().stream()
                .map(Cleanupable.class::cast)
                .forEach(Cleanupable::cleanup);
        servers.clear();
        channels.values().stream()
                .filter(Cleanupable.class::isInstance)
                .map(Cleanupable.class::cast)
                .forEach(Cleanupable::cleanup);
        channels.clear();
        unavailableServers.clear();
        customEmojis.clear();
        messages.clear();
        messageIdByRef.clear();
        timeOffset = null;
    }
1357125
public void clearCache()
  {
    // skip the clear on restart
    if (_lifecycle.isStopping()) {
      return;
    }

    if (log.isLoggable(Level.FINER)) {
      log.finest("clearCache");
    }

    // the invocation cache must be cleared first because the old
    // filter chain entries must not point to the cache's
    // soon-to-be-invalid entries
    getInvocationManager().clearCache();

    /*
    if (_httpCache != null) {
      _httpCache.clear();
    }
    */
  }
773900
function () {
            var cache = this._cache;
            var expirationTime = ((new Date()).getTime() - this._expiresAfter * 1000);

            for (var url in cache) {
                if (cache.hasOwnProperty(url) && cache[url].age < expirationTime) {
                    delete cache[url];
                }
            }
        }
780494
def add_cache_bypass(url):
    
    if not cache_installed():
        return url
    hash_str = ""
    if "#" in url:
        url, hash_str = url.split("#", 1)
        hash_str = "#" + hash_str
    url += "?" if "?" not in url else "&"
    return url + "t=" + str(time()).replace(".", "") + hash_str
52376
def clear_cache():
        """"""
        del Cache._keys
        for k in list(Cache._cache.keys()):
            it = Cache._cache.pop(k)
            del it
        del Cache._cache
        Cache._keys = []
        Cache._cache = {}
        gc.collect()
633522
def clear(url)
      if code_obj = code_object(url)
        @url_bucket.delete  code_obj.key
        @code_bucket.delete code_obj.data
      end
    end
24916
public void purge(String cacheKey) {
        try {
            if (useMemoryCache) {
                if (memoryCache != null) {
                    memoryCache.remove(cacheKey);
                }
            }

            if (useDiskCache) {
                if (diskLruCache != null) {
                    diskLruCache.remove(cacheKey);
                }
            }
        } catch (Exception e) {
            Log.w(TAG, "Could not remove entry in cache purge", e);
        }
    }
830364
public function flushCache()
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter->getCache()->flush();
        }
    }