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:
<<?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">
<html xmlns="http://www.w3.org/1999/xhtml" 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"> </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"> </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"> </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"> </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>
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.
链接地址: http://www.djcxy.com/p/69858.html上一篇: PHP解析错误:语法错误,意外的'endif'(T
下一篇: Zend框架布局或视图滞后
