4

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:

<<?php ?>?xml version="1.0" encoding="UTF-8"?<?php ?>>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml&quot; xml:lang="en" lang="en"> 
<head> 
<link rel="stylesheet" type="text/css" media="screen"
      href="<?php echo $this->baseUrl;?>/public/styles/style.css" /> 
<link rel="stylesheet" type="text/css" media="screen"
      href="<?php echo $this->baseUrl;?>/public/styles/menu.css" /> 
<link rel="shortcut icon"href="<?php echo $this->baseUrl;?>/public/images/favicon.ico">

<script src="<?php echo $this->baseUrl;?>/public/scripts/jquery.js"></script> <script src="<?php echo $this->baseUrl;?>/public/scripts/jquery.corner.js"></script> <script src="<?php echo $this->baseUrl;?>/public/scripts/jquery.media.js"></script> <title><?php echo $this->title . ' - '; echo ($this->cattitle != '') ? $this->cattitle . ' - ' : '';?>Zgarnijlicke.pl</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div id="naglowek"> <div id="logo"><img src="<?php echo $this->baseUrl;?>/public/images/logo.png" width="338px" height="63px" /></div> <div id="szukajka"> <div id="szukaj">Szukaj</div> <div id="poleszukaj"><input name="search" maxlength="20" size="20" value="wpisz cos..." onblur="if(this.value=='') this.value='wpisz cos...';" onfocus="if(this.value=='wpisz cos...') this.value='';" type="text"> </div> </div> </div>
<?php echo $this->partial('top_menu1.phtml', array()); ?>

<div class="clear">&nbsp;</div> <div id="banner"><img src="<?php echo $this->baseUrl;?>/public/images/banner.png" width="994px" height="212px" /> </div>

<?php echo $this->placeholder('top_menu2'); ?>

<div class="clear">&nbsp;</div> <div id="wrapper"> <div id="container"> <div id="side-a"> <div class="widget"><?php echo $this->partial('menu_left_1.phtml', array()); ?></div> <div class="clear">&nbsp;</div> <div class="widget">Lewa strona</div> </div> <div id="content"> <div class="content_elem"><?php echo $this->layout()->content; ?></div> </div> <div id="side-b"> <div class="widget">Prawa strona</div> </div> </div> <div class="clear">&nbsp;</div> <div id="footer"> <img src="<?php echo $this->baseUrl;?>/public/images/stopka.png" width="992px" height="34px" /> </div> </div>

<script type="text/javascript"> $("#menu_top1").corner(); //$(".widget").corner(); //$("#top_menu2").corner(); //$(".content_elem").corner(); $('a.media').media(); </script> </body> </html>

2
  • Do your menu partials do anything complicated or are they just rendering static HTML? Jul 23, 2010 at 16:21
  • No, they only use url() helper to generate url's. It's hard coded menu now, without database.
    – Misiek
    Jul 26, 2010 at 12:11

1 Answer 1

2

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.

4
  • Layout is lagging. Action views not. I'll put my layout code in question. Wait a while pls.
    – Misiek
    Jul 23, 2010 at 7:53
  • I can't use any of this 2 because of some business issues.
    – Misiek
    Jul 23, 2010 at 8:16
  • @Misiek cant see anything wrong with the layout. Also, your page loaded in less than a second for me. If you cannot use a profiler, it will be difficult to find the bottleneck. Cant you help you with that. Sorry.
    – Gordon
    Jul 23, 2010 at 8:22
  • Today it's working faster but something is wrong. It takes to much time to load normal action with view and layout. When I'm only echo'ing JSON data in AJAX controller everything it's ok and the JSON data are showing after 0.1-0.2s
    – Misiek
    Jul 23, 2010 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.