• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter - cache only part of the view

Have you seen or tried this?


You can use this to cache anything you want of an x amount of time.

Depending on your server you will need to choose a driver. The library does check if a driver is available when using the Cache interface. When directly using a cache driver you will need to check manually.
To play it save you can just always use the file driver.

How to use:
PHP Code:
// Load APC cache driver or fallback to file when APC not available
$this->load->driver('cache', array('adapter' => 'apc''backup' => 'file'));

// Get from / Save to cache
if ( ! $foo $this->cache->get('foo')) {
   // Cache 'foo' invalid or not set
   $foo 'foobarbaz!';
// Save into the cache for 5 minutes


It is that easy.

Messages In This Thread
RE: Codeigniter - cache only part of the view - by Martin7483 - 12-14-2015, 03:58 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.