Hi Okto, have you try using the view cache helper = its really great,
or perhaps you could use the plain html cache plugin, that really will
speed up, of course it have some cons...

http://bakery.cakephp.org/articles/mattc/2009/03/20/html-cache-helper

http://book.cakephp.org/view/348/Clearing-the-Cache#!/view/346/Caching-in-the-Controller

Good luck!

2011/2/10 Okto Silaban <o...@silaban.net>:
> Thanks.. :D
>
> I'll try this.
>
> On Fri, Feb 11, 2011 at 12:14 AM, ibejohn818 <john.c.ha...@gmail.com> wrote:
>>
>> This what I am using.
>> ===
>> class AppModel extends Model {
>>
>>
>>
>>        public function save($data = null, $validate = true, $fieldList =
>> array()) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $success = parent::save($data,$validate,$fieldList);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $success;
>>
>>        }
>>
>>        public function saveAll($data = null, $options = array()) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $status = parent::saveAll($data,$options);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>        public function updateAll($fields, $conditions = true) {
>>
>>                $this->useDbConfig = 'master';
>>
>>                $status = parent::updateAll($fields,$conditions);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>        public function delete($id = null, $cascade = true) {
>>
>>                $this->useDbConfig = "master";
>>
>>                $status = parent::delete($id,$cascade);
>>
>>                $this->useDbConfig = 'default';
>>
>>                return $status;
>>
>>        }
>>
>>
>> }
>>
>> ====
>>
>> For multiple Slaves you should use a load balancer to RoundRobin
>> Balance the requests to your slaves.
>>
>>
>> On Feb 10, 9:05 am, Okto Silaban <o...@silaban.net> wrote:
>> > That's what I'm trying to do.
>> > I've setup 1 master and 2 slaves. But CakePHP doesn't support read &
>> > write
>> > query separation.
>> > So, do you have any information how can I split the read & write query?
>> > *other than rewrite all my models
>> >
>> > thanks.
>> >
>> > On Wed, Feb 9, 2011 at 10:03 AM, Dr. Tarique Sani
>> > <tariques...@gmail.com>wrote:
>> >
>> >
>> >
>> > > Have you split the reads and the writes?
>> >
>> > > All the writes go to the master which is on a server of its own and
>> > > the reads are from the slaves which are typically on the same machine
>> > > as the webserver and of course use very aggressive caching
>> >
>> > > Cheers
>> > > Tarique
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to