[請益] 請問smarty怎麼cache檔頭跟黨尾

看板PHP作者 (小貓)時間15年前 (2010/05/27 15:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
如標題!! 請問 EX: index.php header('content-Type=text/html;charset=utf-8'); session_start(); require_once("db.php"); //$smarty->caching = true;//這一行我不想加在這,會連動態資料一起cache, 我問題的關鍵 $smarty->display("index.tpl"); index.tpl <html> <head> </head> <body style="margin:10;"> <div style="width:100%;"> <div style="width:100%;"> <%include file='header.tpl'%>//我想要cache這個html樣板 </div> <div style="clear:both"></div> <div style="width:8%;float:left; margin-top:-14px;"> <%include file='left.tpl'%> //我想要cache這個html樣板 </div> <div style="width:100%; background-color:#FFFFFF;></div> <div style="clear:both"></div> </div> <div style="clear:both"></div> </body> </html> 請問怎麼只cache 檔頭,檔尾樣板阿? 因為直接cache首頁如果有資料庫動態更新的話, 會被cache住,資料呈現會不正確。所以我希望只cache非動態的部分,例如檔頭檔尾 煩請各位大大們替小弟指點迷津。 -- Aman ia vida 地下飛行 http://www.wretch.cc/album/luo74128 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.148.136.58
文章代碼(AID): #1B_XaZSi (PHP)
文章代碼(AID): #1B_XaZSi (PHP)