CakePdf\Pdf\CakePdf::cache PHP Method

cache() public method

Get/Set caching.
public cache ( null | boolean | string $cache = null ) : mixed
$cache null | boolean | string Cache config name to use, If true is passed, 'cake_pdf' will be used.
return mixed
    public function cache($cache = null)
    {
        if ($cache === null) {
            return $this->_cache;
        }
        if ($cache === false) {
            $this->_cache = false;
            return $this;
        }
        if ($cache === true) {
            $cache = 'cake_pdf';
        }
        if (!in_array($cache, Cache::configured())) {
            throw new Exception(sprintf('CakePdf cache is not configured: %s', $cache));
        }
        $this->_cache = $cache;
        return $this;
    }