[請益] include 的效能
我在建置網站的時候
把會用到的連結、connection、div等都寫在header.php
例如:
<?php include "configs/conn.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Newyellow的個人網站</title>
<?php include "mainstyle.php" ?>
</head>
<body>
<div id="wrapper">
<div id="mainlinks">
<?php include "links.php" ?>
</div>
<div id="content">
然後把 </div></body></html>等都寫在footer.php
然後我在做別的頁面的時候
內容就寫:
<?php include "header.php" ?>
//content...
//
//other php codes...
//
<?php include "footer.php" ?>
請問這樣寫會不會效能差?
因為我買了一個虛擬主機
裡面架了兩個站(放在兩個不同資料夾)
一個是 drupal 架的,一個是我自己寫的上述的架構
但有時候會有我自己的架構跑很久跑不太動
但 drupal 卻可以跑的情況
但有時候我自己寫的部分又很順
請問為什麼會這樣呢?
請問我這樣的include寫法是否會不好?
謝謝各位大大
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.119.233.117
→
12/01 22:48, , 1F
12/01 22:48, 1F
→
12/01 22:48, , 2F
12/01 22:48, 2F
推
12/01 23:10, , 3F
12/01 23:10, 3F
→
12/02 13:41, , 4F
12/02 13:41, 4F
→
12/04 09:34, , 5F
12/04 09:34, 5F
→
12/04 21:11, , 6F
12/04 21:11, 6F