Extra Light PHP Framework

Cache

This class is loaded automatically by the system

Content

Configuration

In application/config/config.php:

$config['cache_enabled'] = FALSE; $config['cache_dir'] = './application/cache/'; $config['cache_time'] = 60; // seconds $config['clear_cache_trigger'] = 'clear_cache';

Enabling Caching

<?php class Foo extends Controller { function index() { $this->cache->page(3600); // 3600 seconds } } ?>

Clearing cache dir

1. Set the clear cache trigger in application/config/config.php $config['clear_cache_trigger'] = 'clear_cache'; 2. Open http://BASE_URL/clear_cache

Example :

$config['base_url'] = 'http://localhost/'; $config['clear_cache_trigger'] = 'clear_cache'; Now visit http://localhost/clear_cache