Unset the cache headers of an object
@return boolean
348412
protected function unsetCacheHeaders()
    {
        if (empty($this->cdnCacheHeadersSet)) {
            return false;
        }

        // --------------------------------------------------------------------------

        //  Remove previously set headers
        header_remove('Cache-Control');
        header_remove('Last-Modified');
        header_remove('Expires');
        header_remove('ETag');
        header_remove('X-CDN-CACHE');

        // --------------------------------------------------------------------------

        //  Set new "do not cache" headers
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT', true);
        header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT', true);
        header('Cache-Control: no-store, no-cache, must-revalidate', true);
        header('Cache-Control: post-check=0, pre-check=0', false);
        header('Pragma: no-cache', true);
        header('X-CDN-CACHE: MISS', true);

        return true;
    }
558678
public function clear()
    {
        $result = true;

        foreach (glob("{$this->path}/*.cache") as $filename) {
            if (!unlink($filename)) {
                $result = false;
            }
        }

        return $result;
    }
295478
protected function clearCaches()
    {
        $this->callSilent('clear-compiled');
        $this->callSilent('cache:clear');
        $this->callSilent('route:clear');
        $this->callSilent('config:clear');
        $this->callSilent('view:clear');
        Cache::flush();
    }
315519
private function _deleteCache()
    {
        if ($this->_cache instanceof \Zend_Cache_Core) {
            $this->_cache->remove($this->_cacheid);
            $this->_cache->remove($this->_cacheid . 'trans');
        }
    }
765097
public function clear()
    {
        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('1 = 1')
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to clear cache : %s', $e->getMessage()));

            return false;
        }

        return true;
    }
809099
public function forgetCache()
    {
        foreach (['url', 'js_url'] as $attribute) {
            $key = $attribute.'_'.$this->location;
            Cache::forget($key);
        }
    }
368282
protected function restoreHeaders()
    {
        foreach ($this->savedMessage['headers'] as $name => $savedValue) {
            $headers = $this->getHeaders()->getAll($name);

            foreach ($headers as $key => $value) {
                if (!isset($savedValue[$key])) {
                    $this->getHeaders()->remove($name, $key);
                }
            }
        }
    }
714484
public function clearCache()
    {
        $cachePath = $this->cachePath();

        if (!file_exists($cachePath)) {
            return;
        }

        $dir = new RecursiveDirectoryIterator($cachePath, RecursiveDirectoryIterator::SKIP_DOTS);
        $files = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST);

        foreach($files as $file) {
            $path = $file->getRealPath();
            $file->isDir() ? rmdir($path) : unlink($path);
        }
        rmdir($cachePath);
    }
594475
public function reset()
    {
        foreach (array_keys($this->_loaded) as $name) {
            $this->unload($name);
        }

        return $this;
    }
1368203
public function remove()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_diff($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
216371
public function gc()
	{
		$prefix = $this->options['hash'] . '-cache-';

		foreach ($this->data as $key => $value)
		{
			if (substr($key, 0, strlen($prefix)) == $prefix)
			{
				$value = $this->data[$key];

				if ($this->isDataExpired($value))
				{
					unset($this->data[$key]);
				}
			}
		}

		return true;
	}
970299
public function clear(){
		$result = false;
		$path_json = $this->exdb->conf()->path_cache_dir.'/table_definition.json';
		if(is_file($path_json)){
			unlink($path_json);
		}
		$result = !is_file($path_json);
		return $result;
	}
325980
public function flush()
    {
        // this may take a while, but they shouldn't be flushing in production
        $cache_keys = $this->redis->keys(/* prefixed with cache: */ '*');

        foreach ($cache_keys as $key) {
            $this->redis->del($key);
        }

        unset($cache_keys);

        return true;
    }
489531
public static function clear() {
        try {
            self::getCache()->clear();
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }
65025
public function clearCache() {
        $files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
        foreach ($files as $file) {
            unlink($file);
        }
    }
256358
public static function clearCache()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $sm = $db->getSchemaManager();
        $tableNames = array_map('strtolower', $sm->listTableNames());
        if (in_array('config', $tableNames, true)) {
            $platform = $db->getDatabasePlatform();
            foreach ($sm->listTableColumns('Blocks') as $tableColumn) {
                if (strcasecmp($tableColumn->getName(), 'btCachedBlockRecord') === 0) {
                    $db->query('update Blocks set btCachedBlockRecord = null');
                    break;
                }
            }
            if (in_array('collectionversionblocksoutputcache', $tableNames, true)) {
                $db->exec($platform->getTruncateTableSQL('CollectionVersionBlocksOutputCache'));
            }
        }
    }
341453
public function setCacheHeaders()
    {
        $cacheTime = 31536000; // 1 year
        $this->getHeaders()
            ->set('Expires', gmdate('D, d M Y H:i:s', time() + $cacheTime) . ' GMT')
            ->set('Pragma', 'cache')
            ->set('Cache-Control', 'max-age=' . $cacheTime);

        return $this;
    }