Friday, 25 November 2016

php - Zend Framework layout or view lag



I have a website built on ZF. I don't know why but is lagging as hell. Loading simple page tooks 4s. Time is going down when I disable layout. When rendering is enabled it's working normally. So I can use action views but I can't use layouts. Can it be someting bad with layout? Or I'm not setting up layout properly?



Site: http://zgarnijlicke.pl



Edit:



I'm adding layout code below:





<?xml version="1.0" encoding="UTF-8"?>
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">

href="baseUrl;?>/public/styles/style.css" />

href="baseUrl;?>/public/styles/menu.css" />





<?php echo $this->title . ' - '; echo ($this->cattitle != '') ? $this->cattitle . ' - ' : '';?>Zgarnijlicke.pl







Szukaj




partial('top_menu1.phtml', array()); ?>



 




placeholder('top_menu2'); ?>



 




partial('menu_left_1.phtml', array()); ?>


 

Lewa strona



layout()->content; ?>



Prawa strona




 








Answer



This is impossible to say without any code to review. Do you happen to use the action stack a lot? If so, this is likely the culprit as it goes through the entire dispatch for each call.



Your best bet: use a XDebug or Zend Debugger to find the bottleneck in your application.



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...