Solved

Speeding up Cakephp-based site

Posted on 2011-03-23
4
460 Views
Last Modified: 2013-11-10
Hi, our site is built by using CakePhp framework, the problem is that the response speed is quite slow. Memcached did not help a lot. Is there any way to generate static html files and serve them automatically? are there any other guides for optimizing cakephp?
0
Comment
Question by:darkbluegr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
Phil Phillips earned 300 total points
ID: 35200853
CakePHP has some caching mechanisms, but they don't generate static html files. Matt Curry wrote a plugin that you can use that writes out pure HTML: https://github.com/mcurry/html_cache
The source includes a readme with some instructions on how to get started.  With his implementation, you will need some kind of job scheduler to clear out the "cache".

As far as optimizing, one place to start is with your SQL queries.  If you set CakePHP's debug level to 2 ( modify config/core.php ), you should see all of the SQL run by a page, plus the time each query took.  This should be done in a test environment.  If the SQL debug output is messing with your styling too much, you can hide the SQL output using the following CSS (and view the source to see it):
.cakeSqlLog { display: none; }

Open in new window

0
 

Author Comment

by:darkbluegr
ID: 35325121
Thank you for the response Decorum,

The specific section we would like to speed up is this: www.iamexpat.nl/read-and-discuss

If you go to this link and click on any of the news articles, it will take a while for them to load.

Do you believe the plugin from Matt Curry will help in this case or should we go through a full refactoring of existing code/server upgrade?

0
 
LVL 14

Expert Comment

by:Phil Phillips
ID: 35325279
I think the plugin will help since it seems that there is something on the serverside that is taking a while to process the page.  The plugin will eliminate processing and serve static content.

Still, it doesn't hurt to take a look at the code too. You may not need a full refactoring... like I said, I would start with SQL debugging on and see if there are any horrendous queries slowing you down.  If so, then try tuning the queries first.
0
 

Author Closing Comment

by:darkbluegr
ID: 35326982
Thank you decorum, please send me a message if you are able to have a look at the debug logs on a freelance basis.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question