Codesleeve\AssetPipeline\Filters\ClientCacheFilter::get PHP Method

get() public method

If we make it here then we have a cached version of this asset found in the underlying $cache driver. So we will check the header HTTP_IF_MODIFIED_SINCE and if that is not less than the last time we cached ($lastModified) then we will exit with 304 header.
public get ( string $key ) : string
$key string
return string
    public function get($key)
    {
        $lastModified = $this->getLastTimeModified($key);
        $modifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : 0;
        header('Last-Modified: ' . $lastModified);
        if ($modifiedSince >= $lastModified) {
            header('HTTP/1.0 304 Not Modified');
            exit;
        }
        return $this->cache->get($key);
    }