243,903 Installs and Counting! Get Sparks Now!
Hey! Keep up to date with the project through its beta and public launch by following @getsparks.
Tweet
A Quick Looks At Sparks (EllisLab Official Post)
March 11, 2012
from: codeigniter.com
The Top Sparks of 2011
December 31, 2011
from: codefury.net
CodeIgniter Starter Project − A Starting Point for Any CI Dev
December 12, 2011
from: github.com
NetTuts+ Tutorial for GetSparks
November 24, 2011
from: net.tutsplus.com
A cache library for CodeIgniter that can cache by library call, model call or just custom data via get/write methods.
| Contributor | : philsturgeon |
| : Log in to view | |
| Author Website | : http://philsturgeon.co.uk/ |
| Spark Website | : http://github.com/philsturgeon/codeigniter-cache |
| Repository Type | : git |
| Number of Installs | : 1,046 |
php tools/spark install -v2.0.0 cache
Or download this version manually:
Get cache-2.0.0.zip
CodeIgniter-Cache is a partial caching library for CodeIgniter. It allows you to write and get chunks of data to and from the filesystem. By storing complex or large chunks of data in serialized form on the file system you can relieve stress from the database or simply cache Twitter calls.
// Uncached model call
$this->blog_m->getPosts($category_id, 'live');
// cached model call
$this->cache->model('blog_m', 'getPosts', array($category_id, 'live'), 120); // keep for 2 minutes
// cached library call
$this->cache->library('some_library', 'calcualte_something', array($foo, $bar, $bla)); // keep for default time (0 = unlimited)
// cached array or object
$this->cache->write($data, 'cached-name');
$data = $this->cache->get('cached-name');
// Delete cache
$this->cache->delete('cached-name');
// Delete all cache
$this->cache->delete_all();
// Delete cache group
$this->cache->write($data, 'nav_header');
$this->cache->write($data, 'nav_footer');
$this->cache->delete_group('nav_');
// Delete cache item
// Call like a normal library or model but give a negative $expire
$this->cache->model('blog_m', 'getPosts', array($category_id, 'live'), -1); // delete this specific cache file
Permission your cache folder to be writeable by the web server.