I have an opencart site which Ive been tasked to make faster. It takes approx 3.5 seconds to load, sometimes longer
I can rule out the following causes through trial and error.
- It is not javascript or CSS, in fact I removed everything in header.tpl except for opening the
<head>
and<body>
tags - I can be fairly sure it is not an issue with the server. I have other sites working perfectly fine, and the admin is also very fast for the same site.
- Caching DOES work but its causing a head ache for the client and there are so many products it tends not to be effective. The client needs to clear the cache alot too. To be honest its not getting to the root of the problem either way, its more putting a plaster over it.
- It is happening on all pages, product, category , information
- I have tested just to make sure the issue isnt in the SQL so I change
getProducts()
for instance to$query = "SELECT * FROM oc_products WHERE id = 100000000000000000";
. As expected it produced an empty array but still a slow load. - I can confirm it is NOT a slow connection to the database. I ran breakpoints (
die;
) throughout the system process and there is no slow down in connecting to the DB.
Finally, I began to run breakpoints through the controller itself (e.g. category.php). All was fine and fast until right after
$this->response->setOutput($this->render());die;
So putting die;
before this is there is no lag, straight after there is. Keeping mind I have tried this with header.tpl, footer.tpl, column_left.tpl and column_right.tpl cleared of everything expect empty divs, not to mention I emptied the tpl files that would have been loaded, e.g. category.tpl, I am now out of ideas as to what is causing such a slow load time.