PHP code example of dereuromark / cakephp-url-cache

1. Go to this page and download the library: Download dereuromark/cakephp-url-cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dereuromark / cakephp-url-cache example snippets


   App::uses('UrlCacheAppHelper', 'UrlCache.View/Helper');
   

   CakePlugin::load('UrlCache');

   Configure::write('UrlCache.active', true);
   

   class AppHelper extends UrlCacheAppHelper {
       ...
   }
   

// In your view ctp:
$timeStart = microtime(true);

$url = ['controller' => 'posts', 'action' => 'view'];
for ($i = 0; $i < 10000; $i++) {
	$u = $url;
	$u[] = $i;
	$link = $this->Html->link($i, $u);
}

$timeEnd = microtime(true);
$time = $timeEnd - $timeStart;
debug($time);