/**
  * Handle output buffer
  */
 public function ob_callback($buffer)
 {
     /**
      * Apply WP Fastest Cache optimization for minification
      */
     $wpfc = new WpFastestCacheCreateCache();
     $buffer = $wpfc->callback($buffer);
     // remove cache creation comment
     $buffer = str_replace('<!-- need to refresh to see cached version -->', '', $buffer);
     // delete page cache file
     $extension = 'html';
     $prefix = '';
     @unlink($wpfc->cacheFilePath . "/" . $prefix . "index." . $extension);
     // apply Above The Fold Optimization
     $buffer = $this->CTRL->optimization->process_output_buffer($buffer);
     // update page cache with Above The Fold optimized HTML
     $wpfc->createFolder($wpfc->cacheFilePath, $buffer);
     return $buffer;
 }
Example #2
0
 private function cache()
 {
     include_once 'inc/cache.php';
     $wpfc = new WpFastestCacheCreateCache();
     $wpfc->createCache();
 }