On Dec 30 2007, 11:02 am, Mike Lewis <[EMAIL PROTECTED]> wrote:
> So I installed memcache + added the code to core.php:
>
> Cache::config('default', array('engine' => 'Memcache',
>              'duration' => 3600, //[optional]
>              'probability' => 100, //[optional]
>                  'servers' => array(
>                            'memcache.ip.address'
>                          ), //[optional]
>                    'compress' => true,
>                )
>            );
>
> CakePHP said it detected memcache -- so whats next?
>
> Does it just run on its own, or do I have to add some more code to the
> actual application. If so, what is it?
>
> Thanks,
> Mike

All you need to do from there is use the memcache component and helper
to start caching.

A quick test for memcache:

Set your controller to cache the results of some query data that would
be displayed on the page:

if(!($someData = $this->Memcache->get('someData')))
{
    //get data from DB
    $someData = $this->SomeModel->find( );

    //set memcached value
    $this->Memcache->set('someData', $someData, 3600); //cache for one
hour
}

Upload the controller file with the memcache code and view the page to
cache the data. Then make a change to the data in the DB.  Clear your
cache and refresh the page. If the old data is displayed memcached is
working.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to