第 1 頁 (共 2 頁)
[轉貼]Caching template system
發表於 : 2002-02-27 13:49
由 oO]-[Oo
Source:
http://phpbb.sourceforge.net/phpBB2/vie ... php?t=7495
Author: psoTFX
功用: 加速網頁讀取速度\r
方式:
1. flat file system
2. db system
經討論好像是用flat file比較快.. 有看到的人值得試一下喔..
只要把原來的 includes/template.php 備份起來, 然後把下載的 template_db_cache.php.txt或template_file_cache.php.txt 存成 template.php, 其他步驟就直接到
http://phpbb.sourceforge.net/phpBB2/vie ... php?t=7495 去看了...
使用 flat file system的計的要 chmod 777 /cache 和 /cache/admin
試過以後, 有明顯感覺速度有變快

發表於 : 2002-03-01 08:12
由 ktvktv
如果有複數的templates的話 不知道可不可以用\r
flat file的部分看起來蠻簡單安裝的
只要在/templates/subSilver/ 成立 /cache 和 /cache/admin
我設了幾個測試用的板子 老是覺得很慢 常常有卡住的感覺\r
希望這個可以改善
發表於 : 2002-03-02 09:37
由 ktvktv
不知道我的安裝方法有沒有錯\r
感覺上在速度上好像沒有什麼分別\r
1. 我先下載了template_file_cache.php.txt
2. 我把/includes/template.php 給命名為 temlatebackup.php
3. 我把 template_file_cache.php.txt 改名為 template.php然後上傳到/includes
4. 我到/templates/subsilver/ 裡面 成立 /cache 和 /cache/admin 然後chmod成777
發表於 : 2002-03-03 17:28
由 嚮往藍天
如果打開debug mode的話就會發現運算的速度快了0.1~0.2秒這樣..
其實應該很難友感覺的吧@@|||
發表於 : 2002-03-03 17:44
由 oO]-[Oo
嗯.. 在流量大的網時候才會有比較明顯的感覺.. 快了0.1~0.2秒
發表於 : 2002-03-08 01:28
由 真帆
ktvktv 寫:
1. 我先下載了template_file_cache.php.txt
2. 我把/includes/template.php 給命名為 temlatebackup.php
3. 我把 template_file_cache.php.txt 改名為 template.php然後上傳到/includes
4. 我到/templates/subsilver/ 裡面 成立 /cache 和 /cache/admin 然後chmod成777
我按照ktvktv大大的步驟去做,網頁讀取速度變快了!可是還是有出現一些問題
在討論區的最上面出現了這些東東\r
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\\includes\sessions.php on line 301
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\sessions.php on line 302
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 450
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 451
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 452
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 453
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 454
熱門主題的上面的空白的地方出現下面這幾行東東\r
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\sessions.php on line 301
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\sessions.php on line 302
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 450
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 451
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 452
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 453
Warning: Cannot add header information - headers already sent by (output started at f:\appserv\www\phpbb2\includes\template.php:522) in f:\appserv\www\phpbb2\includes\page_header.php on line 454
這是什麼問題ㄌㄟ?
我的系統是win2000 pro
appserv-win32-1.4.0
phpBB2是竹貓1.22正體中文版
發表於 : 2002-03-08 01:32
由 oO]-[Oo
Carol你應該少了第四步\r
1. 我先下載了template_file_cache.php.txt
2. 我把/includes/template.php 給命名為 temlatebackup.php
3. 我把 template_file_cache.php.txt 改名為 template.php然後上傳到/includes
4. 我到/templates/subsilver/ 裡面 成立 /cache 和 /cache/admin 然後chmod成777
KTV的做法完全正確
發表於 : 2002-03-08 01:58
由 真帆
OOHOO大大:
那個chmod要如何改成777
我是知道用cuteftp上傳後可以修改chmod,but我是架在自己家的電腦上,並沒有上傳,這樣要如何改ㄌㄟ?
發表於 : 2002-03-08 02:00
由 oO]-[Oo
家裡是用啥?
發表於 : 2002-03-08 02:16
由 真帆
win2000+阿帕契+中華電信ADSL動態ip+dns2go轉址
我的編輯器是UltraEdit
發表於 : 2002-03-08 02:33
由 oO]-[Oo
你先改回來, 然後查一下 /includes/page_header.php 的450~454行
發表於 : 2002-03-08 15:23
由 真帆
OOHOO大大:
我的/includes/page_header.php的450~454行是這樣的
代碼: 選擇全部
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: pre-check=0, post-check=0, max-age=0");
header ("Pragma: no-cache");
header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
這是怎樣ㄌㄟ?
發表於 : 2002-03-08 15:34
由 oO]-[Oo
檢查一下你的template.php, 看看最下面 ?> 以後還有沒有多餘的空行, 刪掉 ?> 以後的所有空行(指標要粘在?>的屁股).
如果還不行的話, 你可以試試另一種用db的cache方式,
http://phpbb.sourceforge.net/phpBB2/vie ... php?t=7495 也有講, 步驟差不多,
不同的是以db來儲存這些快取資料...
發表於 : 2002-03-08 15:52
由 真帆
OOHOO大大:
我解決了,原來是真的多一行啊!
原本在官方站也有看到,我也有試,可是都有問題,經大大這麼一說才知道我刪錯方向囉!
大大謝謝您囉!
發表於 : 2002-03-19 14:02
由 ricky777
嚮往藍天 寫:如果打開debug mode的話就會發現運算的速度快了0.1~0.2秒這樣..
其實應該很難友感覺的吧@@|||
請問一下debug mode要在哪邊開啟/關閉呀?