Caching is very useful, check out Mile's sql cache code
http://www.milesj.me/blog/read/34/Cacheing-Each-Query-Individually
Cheers,
J
On 2 April 2010 14:12, alex bailey <vile@planet-generals.de> wrote:
> Hi people :)
>
> I've been working on my cakephp project for some time now and now i
> start to realize that I must be able to do something with the
> performance. I've read alot of tutorials and I will for sure use them
> later on but now I have a different concern. Lets say for example I
> have a Car model a car has a user, speed, name etc.
> Every user who is logged in has a certain car like
>
> User id 4 has car id 4
> User id 5 has car id 5
>
> You get the idea.
>
> Now what my problem:
>
> I have to use this 1 car belonging to the user in many different
> controllers.
> The result is I use something like $this->Car->findById(5); very
> often creating maybe 5-6 times the same query on 1 page!
>
> Is there a way to reduce this somehow? Like fetching the model data
> once and use it for all controllers or cache it somewhere for that 1
> user?
>
> I really appreciate any help.
>
> Regards
>
> Alex
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>
--
jon bennett - www.jben.net - blog.jben.net
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment