我有一個建立在ZF上的網站。我不知道爲什麼,但落後於地獄。加載簡單頁面需要4s。當我禁用佈局時,時間正在減少。渲染啓用時,它正常工作。所以我可以使用動作視圖,但我不能使用佈局。它可能與佈局有些不好嗎?或者我沒有正確設置佈局?Zend框架佈局或視圖lag
編輯:
我添加以下佈局代碼:
<<?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>
你的菜單部分是否做了任何複雜的事情,或者他們只是呈現靜態HTML? – 2010-07-23 16:21:38
不,他們只使用url()助手來生成url的。這是現在硬編碼的菜單,沒有數據庫。 – Misiek 2010-07-26 12:11:53