开发者

How can I boost my performance in a CakePHP application?

开发者 https://www.devze.com 2023-02-14 15:25 出处:网络
I\'m currently using CakePHP for my training plan application but I have rendering times of 800 ms per page.

I'm currently using CakePHP for my training plan application but I have rendering times of 800 ms per page.

Do you have any tips on开发者_C百科 improving the performance?

Thanks in advance.

br, kms


In general the tool that will give you the greatest speed boost is caching, and CakePHP has a dedicated helper. The second most useful thing to do is optimizing the queries, only asking for the data you need - this can be done with the containable behavior.

You can find more detailed tips in this post.


Install APC, if you dont have it. that will instantly make it < 500ms. also without touching a single line of code.

Make sure your tables have all the proper indexes so that queries are as fast as they can be.

Next up look at some things about caching routes / urls as that is a huge drain.

Those will give you the most speed boost for the least amount of work


Have you tried any of the CSS/JS asset combiners for CakePHP? They combine/compress/minify your CSS/JS scripts and cache them where applicable. Here's one that's quite recent.

Not specific to CakePHP but you could go through all the factors in Google Page Speed, it will help you speed up your page loading times by suggesting what scripts you could combine and advice on how to reduce requests.

Other than that, look into the containable behaviour, see if you can cut out any necessary info/queries by only selecting what you need at any time.


This question is well-populated with information on speeding Cake up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号