Renders and returns a Cache-Control header, based on the previously set
cache control directives.

@return string Either the value of the header or NULL if it shall be omitted
@see get()
184588
protected function getCacheControlHeader()
    {
        $cacheControl = '';
        foreach ($this->cacheDirectives as $cacheDirective) {
            $cacheControl .= ($cacheDirective !== '' ? $cacheDirective . ', ' : '');
        }
        $cacheControl = trim($cacheControl, ' ,');
        return ($cacheControl === '' ? null : $cacheControl);
    }
988375
public function getCache()
    {
        if (null == $this->cache) {
            $this->setCache(Cache::get(Cache::CACHE_MEMORY));
        }
        return $this->cache;
    }
689319
public function forTemplate()
    {
        if (!$this->canBeCached()) {
            HTTPCacheControlMiddleware::singleton()->disableCache();
        }

        $return = $this->renderWith($this->getTemplates());

        // Now that we're rendered, clear message
        $this->clearMessage();

        return $return;
    }
990427
protected function getContentFromCache()
    {
        $cache_key = $this->widget->cacheKey();
        $cache_time = $this->widget->cacheTime();

        // Check the existence of the cache.
        if (! cache()->has($cache_key)) {
            // If cache is empty and validation is fails.
            $this->checkWidgetParams();
            // If cache is empty and template file does not exists.
            $this->checkWidgetTemplate();
        }

        return cache()->remember($cache_key, $cache_time, function () {
            return $this->getContent();
        });
    }
571803
function render()
    {
        $return = $this->renderHeaders();

        $body = $this->getBody();
        if ($body instanceof iStreamable) {
            if ($body->resource()->isSeekable()) $body->rewind();
            while (!$body->isEOF())
                $return .= $body->read(24400);
        } else {
            $return .= $body;
        }

        return $return;
    }
602696
private function getCached() {
        if (isset($_GET['noCache'])) return null;
        $cacheDir = DATA . 'select' . DIRECTORY_SEPARATOR;
        if (!is_dir($cacheDir)) mkdir($cacheDir, 0777, true);

        $cache = $cacheDir . base64_encode($this->getName()) . '.php';
        if (!is_readable($cache)) return null;
        $cached = include $cache;
        return $this->decode($cached[$this->encode($this->query . serialize($this->values))]);
    }
89418
public function header()
    {
        // If we have tab content
        if (isset($this->content_html{0})) {
            // Tab sub-headers html
            $sub_headers = '';

            // Iterate tab group tabs only if there is atleast two sub headers
            if (sizeof($this->tabs) > 2) {
                foreach ($this->tabs as $tab) {
                    // Don't render this tab as sub header
                    if ($tab == $this) continue;

                    // Render tab header as sub-header
                    $sub_headers .= m()->view($this->header_view)->tab($tab)->output();
                }
            }

            // Render just last tab
            $this->header_html .= m()
                ->view($this->header_view)
                ->sub_headers($sub_headers)
                ->class(isset($sub_headers{0}) ? 'sub-tabs-list' : '')
                ->tab($this)// Pass this tab object as main
                ->tab_id(end($this->tabs)->id)// Pass last tabs object id as identifier
                ->output();
        }

        return $this->header_html;
    }
188455
public String getCacheControlHeader() {
        checkIfMaxAgeIsResolved();
        String maxAge = Directive.MAX_AGE.getName() + "=" + (maxAgeResolvedValue > 0 ? maxAgeResolvedValue : "0");
        return staticDirectives.toString() + maxAge;
    }
553076
public function getCacheControlDirective($key)
    {
        return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null;
    }
137066
public function renderHeaderCell()
	{
		if ($this->grid->json) {
			$header = array('id' => $this->id);
			$content = array();
			if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
				$sort = $this->grid->dataProvider->getSort();
				$label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);

				if ($sort->resolveAttribute($this->name) !== false) {
					$label .= '<span class="caret"></span>';
				}
				$content['content'] = $sort->link($this->name, $label, array('class' => 'sort-link'));
			} else {
				if ($this->name !== null && $this->header === null) {
					if ($this->grid->dataProvider instanceof CActiveDataProvider) {
						$content['content'] = CHtml::encode(
							$this->grid->dataProvider->model->getAttributeLabel($this->name)
						);
					} else {
						$content['content'] = CHtml::encode($this->name);
					}
				} else {
					$content['content'] = trim($this->header) !== '' ? $this->header
						: $this->grid->blankDisplay;
				}
			}
			return CMap::mergeArray($header, $content);
		}
		parent::renderHeaderCell();
	}
1228341
public function renderHeader()
    {
        if (!$this->isAddButtonPositionHeader()) {
            return '';
        }

        $options = ['class' => 'list-cell__button'];
        $layoutConfig = array_merge([
            'buttonAddClass' => $this->isBootstrapTheme() ? 'col-sm-offset-9 col-sm-3' : '',
        ], $this->layoutConfig);
        Html::addCssClass($options, $layoutConfig['buttonAddClass']);

        return Html::tag('div', $this->renderAddButton(), $options);
    }
509373
private function getCache()
    {
        // cache for single run
        // so that getLastModified and getContent in single request do not add additional cache roundtrips (i.e memcache)
        if (isset($this->parsed)) {
            return $this->parsed;
        }

        // check from cache first
        $cache = null;
        $cacheId = $this->getCacheId();
        if ($this->cache->isValid($cacheId, 0)) {
            if ($cache = $this->cache->fetch($cacheId)) {
                $cache = unserialize($cache);
            }
        }

        $less = $this->getCompiler();
        $input = $cache ? $cache : $this->filepath;
        $cache = $less->cachedCompile($input);

        if (!is_array($input) || $cache['updated'] > $input['updated']) {
            $cache['lastModified'] = $this->getMaxLastModified($cache);
            $this->cache->store($cacheId, serialize($cache));
        }

        return $this->parsed = $cache;
    }
1084694
public function getCacheControlDirective($key) {

		return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : NULL;
	
	}
498243
public function header()
    {
        if ($this->header_translated) {
            return cms_trans($this->header_translated);
        }

        if ($this->header) {
            return $this->header;
        }

        return ucfirst(str_replace('_', ' ', snake_case($this->source)));
    }
385894
public function getCacheControl() {
        if (!isset($this->metadata[OSSHeaders::CACHE_CONTROL])) {
            return null;
        }
        return $this->metadata[OSSHeaders::CACHE_CONTROL];
    }
765756
protected function parseCacheControl($header)
    {
        $cacheControl = [];
        \preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);
        foreach ($matches as $match) {
            $cacheControl[\strtolower($match[1])] = $match[3] ?? ($match[2] ?? true);
        }

        return $cacheControl;
    }
710616
public function getData()
    {
        if ($this->cacheProvider !== null &&
            $this->cacheProvider->contains('routerCache')) {
            return $this->cacheProvider->fetch('routerCache');
        }

        return parent::getData();
    }