Skip to content Skip to sidebar Skip to footer

Meta Cache Or Codeigniter Cache

Which cache should i make use to reduce the loading time of a page - Meta Cache or Codeigniter Caching. Please suggest.

Solution 1:

for me i tried CI Cache and it was good ... most of the people will say that this is your own choice and you have to decide based on your project requirement ..

but for sure the best answer is to try this and try that then chose the best for your case

Solution 2:

Depends what are your needs.

If you don't need some more specific and it's no problem with caching the entire page, you should to use Web Page Caching. This is very very simple and will suit you.

If it's something more specific, maybe you should try a look in the Caching Driver, wich permits you to use a variety of diferent types of cache (including memcache). The most advantage is you can cache specific chunks of code (very useful to projects with diferent page modules needs).

And, if you want to try some third-part stuff, I highly recomend the Phil Sturgeon CodeIgniter Cache Library, wich also works with codes chunks and it's very easy to use, generating quickly text-based caches.

Regards!

Solution 3:

I recently used Stash; http://code.google.com/p/stash/, at work and it's great. It uses a hierarchical key structure which is really useful for caching related items.

I used this library file to integrate it as a third party package and away I went.

<?phpclassStash{

    private$_pool;

    publicfunction__construct($options)
    {
        include_once APPPATH . '/third_party/Stash/autoload.php';

        if (isset($options['stash']) && isset($options['stash']['path'])) {
            if (substr($options['stash']['path'], 0, 1) != '/') {
                $options['stash']['path'] = getcwd() . '/' . $options['stash']['path'];
            }
        }

        $handler = new Stash\Handler\FileSystem(@$options['stash']);

        $this->_pool = new Stash\Pool;
        $this->_pool->setHandler($handler);
    }

    publicfunctiongetCache($path)
    {
        return$this->_pool->getCache($path);
    }
}

?>

Just use this simple config file:

<?phpif ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Stash Cache settings
| -------------------------------------------------------------------
|
*/$config['stash'] = array('path' => APPPATH .'/cache');

Then you can use it like this:

$this->load->library('Stash');
$cache = $this->stash->getCache(array('key1','subkey1','subkey2'));
$cache->set('foo', 'bar', 30);

Post a Comment for "Meta Cache Or Codeigniter Cache"