Using plugins slows down CakePHP

2019-10-03 03:48发布

I am using 7-8 plugins with CakePHP, and the webpage takes from 3 to 6s to load . Why do plugins slow down CakePHP so much? O_O. I found out it is slow because it loads model in plugins (I disabled Cake's cache globally) (I use localhost to develop the website, Debug level = 2)

Using DebugKit, I found out Component initialization and startup takes 3s->6s, but I can't solve the problem.


i disabled all plugins and ONLY in model i add line

var $acts = array('Search.searchable','Tags.Tagged');(I disabled Cake's cache globally, disabled cache check and Cache.disable = true)

time load change from 1s -> 4s only with 1 line load Behavior in plugins 2 plugin code by core team cakePHP i dont think matter in plugin.

1条回答
Animai°情兽
2楼-- · 2019-10-03 04:36

You can have hundreds of plugins that don't do anything and have the page load in no time at all. Or you can have only one plugin that does a lot, or does it poorly, and have the page load time out. It's really not about the number, it's about what each plugin is doing.

As such, you either need to profile your app on a low level (e.g. http://www.xdebug.org/docs/profiler) or you need to switch plugins off one by one to see which one is the culprit.

查看更多
登录 后发表回答