[轉貼]Caching template system

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

[轉貼]Caching template system

文章 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

試過以後, 有明顯感覺速度有變快 (:Y)
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
頭像
ktvktv
星球普通子民
星球普通子民
文章: 21
註冊時間: 2001-12-19 03:35

文章 ktvktv »

如果有複數的templates的話 不知道可不可以用\r

flat file的部分看起來蠻簡單安裝的
只要在/templates/subSilver/ 成立 /cache 和 /cache/admin

我設了幾個測試用的板子 老是覺得很慢 常常有卡住的感覺\r
希望這個可以改善
頭像
ktvktv
星球普通子民
星球普通子民
文章: 21
註冊時間: 2001-12-19 03:35

文章 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
嚮往藍天
星球普通子民
星球普通子民
文章: 10
註冊時間: 2002-02-09 01:14
來自: 台中
聯繫:

文章 嚮往藍天 »

如果打開debug mode的話就會發現運算的速度快了0.1~0.2秒這樣..
其實應該很難友感覺的吧@@|||
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 oO]-[Oo »

嗯.. 在流量大的網時候才會有比較明顯的感覺.. 快了0.1~0.2秒
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
真帆
星球公民
星球公民
文章: 98
註冊時間: 2002-01-19 23:35
來自: 台北
聯繫:

文章 真帆 »

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正體中文版
荷葉何田田,戲水荷池西,
蓮葉雖豐潤,心中含苦悲。
荷葉何田田,戲水畫堂東,
荷花雖言美,凋殘亦匆匆!
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 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的做法完全正確
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
真帆
星球公民
星球公民
文章: 98
註冊時間: 2002-01-19 23:35
來自: 台北
聯繫:

文章 真帆 »

OOHOO大大:
那個chmod要如何改成777
我是知道用cuteftp上傳後可以修改chmod,but我是架在自己家的電腦上,並沒有上傳,這樣要如何改ㄌㄟ?
荷葉何田田,戲水荷池西,
蓮葉雖豐潤,心中含苦悲。
荷葉何田田,戲水畫堂東,
荷花雖言美,凋殘亦匆匆!
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 oO]-[Oo »

家裡是用啥?
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
真帆
星球公民
星球公民
文章: 98
註冊時間: 2002-01-19 23:35
來自: 台北
聯繫:

文章 真帆 »

win2000+阿帕契+中華電信ADSL動態ip+dns2go轉址
我的編輯器是UltraEdit
荷葉何田田,戲水荷池西,
蓮葉雖豐潤,心中含苦悲。
荷葉何田田,戲水畫堂東,
荷花雖言美,凋殘亦匆匆!
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 oO]-[Oo »

你先改回來, 然後查一下 /includes/page_header.php 的450~454行
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
真帆
星球公民
星球公民
文章: 98
註冊時間: 2002-01-19 23:35
來自: 台北
聯繫:

文章 真帆 »

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");
這是怎樣ㄌㄟ?
荷葉何田田,戲水荷池西,
蓮葉雖豐潤,心中含苦悲。
荷葉何田田,戲水畫堂東,
荷花雖言美,凋殘亦匆匆!
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 oO]-[Oo »

檢查一下你的template.php, 看看最下面 ?> 以後還有沒有多餘的空行, 刪掉 ?> 以後的所有空行(指標要粘在?>的屁股).
如果還不行的話, 你可以試試另一種用db的cache方式, http://phpbb.sourceforge.net/phpBB2/vie ... php?t=7495 也有講, 步驟差不多,
不同的是以db來儲存這些快取資料...
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
真帆
星球公民
星球公民
文章: 98
註冊時間: 2002-01-19 23:35
來自: 台北
聯繫:

文章 真帆 »

OOHOO大大:
我解決了,原來是真的多一行啊!
原本在官方站也有看到,我也有試,可是都有問題,經大大這麼一說才知道我刪錯方向囉!
大大謝謝您囉!
荷葉何田田,戲水荷池西,
蓮葉雖豐潤,心中含苦悲。
荷葉何田田,戲水畫堂東,
荷花雖言美,凋殘亦匆匆!
ricky777
星球普通子民
星球普通子民
文章: 1
註冊時間: 2002-03-19 12:24

文章 ricky777 »

嚮往藍天 寫:如果打開debug mode的話就會發現運算的速度快了0.1~0.2秒這樣..
其實應該很難友感覺的吧@@|||
請問一下debug mode要在哪邊開啟/關閉呀?
主題已鎖定

回到「非官方認證外掛」