Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
293 views
in Technique[技术] by (71.8m points)

Using plugins slows down CakePHP

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...