2017 © Pedro Peláez
 

cakephp-plugin url-cache

CakePHP URL Cache Plugin

image

sams/url-cache

CakePHP URL Cache Plugin

  • Sunday, July 27, 2014
  • by spandansingh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 20 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Description

Whenever you use $this->Html->link() in your CakePHP views the Cake Router has to scan through all your routes until it finds a match. This can be slow if you have a lot of links on a page or use a lot of custom routes. By adding this code to your AppHelper the urls are cached, speeding up requests. The cache settings follow the same rules as the other Cake core cache settings. If debug is set to greater than 0 the cache expires in 10 seconds. With debug at 0 the cache is good for 999 days., (*1)

Instructions

  1. Download the plugin to /app/Plugin/UrlCache
  2. Put at the top of your app/View/Helper/AppHelper.php, (*2)

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

  3. Have your AppHelper extend UrlCacheAppHelper instead of Helper, (*4)

    class AppHelper extends UrlCacheAppHelper { ... }, (*5)

  4. Thats it! Just continue using $this->Html->link as you usually do., (*6)

By default all the cache will be stored in one file. You can set the option Configure::write('UrlCache.pageFiles', true) and each page will keep a seperate cache. I added this option in the event your site has a ton of unique urls don't want to store them all in one giant cache, which would need to be loaded each request., (*7)

The Versions

27/07 2014

dev-master

9999999-dev https://github.com/sams/UrlCache

CakePHP URL Cache Plugin

  Sources   Download

The Requires

 

by Avatar sams

cakephp url cache engine