Sends a "Cache-Control" HTTP header.

@param boolean $doCache        Use caching?
@param boolean $mustRevalidate Should be checked on each request, if a used cache is valid?
11434
public static function SendCacheControl( bool $doCache = false, bool $mustRevalidate = true )
   {

      \header(
         'Cache-Control: '
            . ( $doCache ? 'cache' : 'no-cache' )
            . ( $mustRevalidate ? ', must-revalidate' : '' )
      );

   }
46402
public function initCache(Cache $cache, $enableCache = false)
    {
        $this->cache          = $cache;
        $this->isCacheEnabled = $enableCache;

        if ($enableCache) {
            $this->cache->enable();
        } else {
            $this->cache->disable();
        }

        return $this;
    }
521244
public void invalidateHeadCache(Byte key, String value) {
        if (headerCache != null && headerCache.containsKey(key)) {
            String old = headerCache.get(key);
            if (!old.equals(value)) {
                throw new SofaRpcRuntimeException("Value of old is not match current");
            }
            headerCache.remove(key);
        }
    }
372516
private function docIsCompatible($headerValidator, $fileContent, $docheaderFile)
    {
        return $headerValidator->__invoke($fileContent) || false !== strpos($fileContent, $docheaderFile);
    }
1191317
public static function setCasServerCACert($cert, $validate_cn = true)
    {
        phpCAS :: traceBegin();
        phpCAS::_validateClientExists();

        try {
            self::$_PHPCAS_CLIENT->setCasServerCACert($cert, $validate_cn);
        } catch (Exception $e) {
            phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
        }

        phpCAS :: traceEnd();
    }
662280
@Nonnull
  public TypeaheadRemote setCache (@Nonnull final ETriState eCache)
  {
    m_eCache = ValueEnforcer.notNull (eCache, "Cache");
    return this;
  }
449223
protected function _sendFile($src, $mime, $cache = true)
    {

        // Custom headers
        foreach ($this->_headers as $header => $value) {
            header($header.': '.$value);
        }

        // Send basic headers
        header('Content-Type: '.$mime);
        header('Content-Length: '.filesize(@is_link($src) ? @readlink($src) : $src));

        // If the client browser should cache the image
        if ($cache) {
            header('Cache-Control: private, max-age='.SQUEEZR_CACHE_LIFETIME);
            header('Expires: '.gmdate('D, d M Y H:i:s', time() + SQUEEZR_CACHE_LIFETIME).' GMT');
            header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($src)).' GMT');
            header('ETag: '.$this->_calculateFileETag($src));

            // Else
        } else {
            header('Cache-Control: no-cache, must-revalidate');
            header('Expires: '.gmdate('D, d M Y H:i:s', time() - SQUEEZR_CACHE_LIFETIME).' GMT');
        }

        readfile($src);
        exit;
    }
997429
public function updateCache() {
		parent::updateCache();
		$bcache = \Brilliant\BFactory::getCache();
		if (empty($bcache)) {
			return false;
			}
		$parentid = $this->{$this->parentKeyName};
		if (empty($parentid)) {
			return true;
			}
		$cachekey = $this->tableName . ':itemid:' . $parentid;
		$bcache->delete($cachekey);
		//Update some lists
		$params = array();
		$params['group'] = $this->getGroupId();
		$params['parentisnull'] = true;
		$collname = $this->collectionName;
		$bitems = $collname::getInstance();
		$cachekey = $bitems->itemsFilterHash($params);
		$bcache->delete($cachekey);
		//All is ok
		return true;
	}
47766
protected function _setCatCache($aCache)
    {
        \OxidEsales\Eshop\Core\Registry::getConfig()->setGlobalParameter('aLocalCatCache', $aCache);
        \OxidEsales\Eshop\Core\Registry::getUtils()->toFileCache('aLocalCatCache', $aCache);
    }
1067817
protected function verifyServerMemoryValues($key, $necessaryValueInBytes)
    {
        $serverValueInBytes = $this->returnBytes(ini_get($key));

        if ($serverValueInBytes == -1) {
            return true;
        }

        return ($serverValueInBytes >= $necessaryValueInBytes);
    }
289165
protected void invalidateCache(T bo, CacheInvalidationReason reason) {
        final String cacheKey = cacheKey(bo);
        switch (reason) {
        case CREATE:
        case UPDATE:
            putToCache(getCacheName(), cacheKey, bo);
        case DELETE:
            removeFromCache(getCacheName(), cacheKey);
        }
    }
1234739
public function setCacheControl(string $cache_control)
    {
        if (empty($cache_control)) {
            Throw new HeaderException('Empty cache control string is not allowed.');
        }

        $this->cache_control = $cache_control;
    }
1266932
protected function _setServiceCache($serviceCache)
    {
        if ($serviceCache !== null && !($serviceCache instanceof ContainerInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid cache'), null, null, $serviceCache);
        }

        $this->serviceCache = $serviceCache;
    }
276629
public function Caching($Caching = NULL) {
      if (!is_null($Caching))
         $this->UseCaching = (bool)$Caching;
      return $this->UseCaching;
   }
658723
public function setCacheTTL($hours)
    {
        if (GenericValidator::validateExpirationTime($hours)) {
            $this->cacheTTL = $hours;
            return true;
        }
        return false;
    }
938357
public function set($key, $values, $replace = true)
    {
        $key = str_replace('_', '-', strtolower($key));

        if (\is_array($values)) {
            $values = array_values($values);

            if (true === $replace || !isset($this->headers[$key])) {
                $this->headers[$key] = $values;
            } else {
                $this->headers[$key] = array_merge($this->headers[$key], $values);
            }
        } else {
            if (true === $replace || !isset($this->headers[$key])) {
                $this->headers[$key] = [$values];
            } else {
                $this->headers[$key][] = $values;
            }
        }

        if ('cache-control' === $key) {
            $this->cacheControl = $this->parseCacheControl(implode(', ', $this->headers[$key]));
        }
    }
1278940
public function hasDirectory()
    {
        if (!is_dir($this->getPath()) && !mkdir($this->getPath(), 0775, true)) {
            throw new InvalidCacheDirectoryException('Unable to create cache directory ');
        } elseif (
            !is_readable($this->getPath()) ||
            !is_writable($this->getPath())
        ) {
            if (!chmod($this->getPath(), 0775)) {
                throw new InvalidCacheDirectoryException(
                    'Cache Path Error '.$this->getPath().' directory must be writable'
                );
            }
        }

        return true;
    }