public function init()
    {
        if ($this->config()->isDryRunMode()) {
            $this->log('Dry run mode is on. Live content is displayed, no cached output.');
        }

        $this->log(__METHOD__ . ' uri:' . $_SERVER['REQUEST_URI']
            . '; script:' . $_SERVER['SCRIPT_NAME'] . '; query:' . $_SERVER['QUERY_STRING'] . '.');

        // Search for valid cache item for current request
        $item = $this->getCurrentItem();

        // Display cache item if found (it might have empty contents, extra check is made inside displayItem)
        if ($item) {
            $this->displayItem($item);
        }

        $this->log(__METHOD__ . ' Cache item not found for hash ' . $this->getCurrentKey());

        /**
         * Cache item not found. Fetch content, save it, display it on this run.
         */
        ob_start([$this, 'storePageHandler']);
    }
public function init()
    {
        if ($this->config()->isDryRunMode()) {
            $this->log('Dry run mode is on. Live content is displayed, no cached output.');
        }

        $this->log(__METHOD__ . ' uri:' . $_SERVER['REQUEST_URI']
            . '; script:' . $_SERVER['SCRIPT_NAME'] . '; query:' . $_SERVER['QUERY_STRING'] . '.');

        // Search for valid cache item for current request
        $item = $this->getCurrentItem();

        // Display cache item if found (it might have empty contents, extra check is made inside displayItem)
        if ($item) {
            $this->displayItem($item);
        }

        $this->log(__METHOD__ . ' Cache item not found for hash ' . $this->getCurrentKey());

        /**
         * Cache item not found. Fetch content, save it, display it on this run.
         */
        ob_start([$this, 'storePageHandler']);
    }
public function init ( ) { if ( $ this -> config ( ) -> isDryRunMode ( ) ) { $ this -> log ( 'Dry run mode is on. Live content is displayed, no cached output.' ) ; } $ this -> log ( __METHOD__ . ' uri:' . $ _SERVER [ 'REQUEST_URI' ] . '; script:' . $ _SERVER [ 'SCRIPT_NAME' ] . '; query:' . $ _SERVER [ 'QUERY_STRING' ] . '.' ) ; // Search for valid cache item for current request $ item = $ this -> getCurrentItem ( ) ; // Display cache item if found (it might have empty contents, extra check is made inside displayItem) if ( $ item ) { $ this -> displayItem ( $ item ) ; } $ this -> log ( __METHOD__ . ' Cache item not found for hash ' . $ this -> getCurrentKey ( ) ) ; /**
         * Cache item not found. Fetch content, save it, display it on this run.
         */ ob_start ( [ $ this , 'storePageHandler' ] ) ; }
Initialize cache.
If you need to set configuration options, do so before calling this method.
Initialize cache . If you need to set configuration options do so before calling this method .