• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 470
  • Last Modified:

Speeding up Cakephp-based site

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
darkbluegr
Asked:
darkbluegr
  • 2
  • 2
1 Solution
 
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
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
 
darkbluegrAuthor Commented:
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
 
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
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
 
darkbluegrAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now