[mlimg][xlang:en]
== THE FASTEST CACHE HACK for XOOPS ==

[b]SUMMARY:[/b]

A hack for Page Caching of XOOPS.

This hack is not for novices but for experts. :-)



[b]USAGE:[/b]

(1) copy fastestcache.php into your XOOPS_ROOT_PATH/include/

(2) make a new folder out of DocumentRoot  eg) /home/yourhome/xoops/

(3) make a new folder named "fullcache" under the folder made in step2. Then, chmod 777 fullcache/ .

(4) insert a line into just after defining XOOPS_URL in mainfile.php. (Edit '/home/yourhome/xoops')
[code]
	define('XOOPS_TRUST_PATH','/home/yourhome/xoops');
[/code]

(5) insert a line into just before including common.php (out of if part) in mainfile.php.
[code]
	require XOOPS_ROOT_PATH.'/include/fastestcache.php' ;
[/code]
If you use EMLH, this line should be inserted after EMLH.
If you use Protector, this line should be inserted just before precheck.

(6) insert a line into just after including common.php (inside if part) in mainfile.php
[code]
	if (!isset($xoopsOption['nocommon']) ... ) {
		include XOOPS_ROOT_PATH."/include/common.php";
		fastestcache_setcookie() ; // Insert this
	}
[/code]

(7) open include/functions.php and insert a line into the top of function redirect_header().
[code]
function redirect_header($url, $time = 3, $message = '', $addredirect = true)
{
    fastestcache_clearcache() ; // Insert this

    global $xoopsConfig, $xoopsRequestUri, $xoopsLogger, $xoopsUserIsAdmin;
[/code]

If you've updated XOOPS core version, patch include/functions.php again.



[b]CHANGELOG[/b]

2006-06-30 0.26
- fixed the judgement whether content is html or not (thx suin)

2006-06-27 0.25
- modified for environment with empty $_SERVER['REQUEST_URI']

2006-02-23 0.24
- fixed register.php can't be cacheable

2006-02-19 0.23
- fixed a bug on login'in and login'out. (thx biroron)
- disabled any caches for admin areas

2006-02-13 0.22
- added a configuration of a regex pattern for excluding some URIs.

2006-01-29 0.21
- fixed a bug about user cannot register (thx harasaki)

2006-01-03 0.20
- added two configurations (cache lifetime is separated by 2 - users&guests)
- removing session_id() in the contents before storing it
- fixed a bug with the login reflection

2005-12-30 0.11
- added the English document
- removed some debugging codes

2005-12-29 0.10
- The 1st experimental version


                    by GIJOE    http://www.peak.ne.jp/xoops/

[/xlang:en]
[xlang:ja]

 ®åϥå (FCH) 

Ĺ

ڡޤ뤴ñ̤ǥå夹®ϥåǤ

ȤϤʤ񤷤ˡåˤĤƤδ򤷤ƤʤȻפ̥ƥۡθˤʤޤΤǡ褷ƽ鿴ԸǤϤޤ󡣤դ

ޤۺHackǤEMLH䥪ȥȤϰ褷Ƥޤ¾HackȤΥХåƥ󥰤βǽϼΤڤޤ



ͭ

¤ϤHackͭȤʤ륱Ϥʤ¤Ƥޤˤ˥륵Ȥǡ٤ˤʤäƤǤʤСۤȤɰ̣ʤǤ礦

ʤȤǤСåۤȤɥҥåȤޤ󤷡åˤ륪СإåɤǤष٤ʤǤ

ʤHackϸŪˡ󥿡䥢ϥ⥸塼ͭˤʤޤ󡣤Ȥˤ⡢ѤϤǤޤ



Ȥ

(1) Υ֤˴ޤޤ fastestcache.php XOOPS󥹥ȡǥ쥯ȥinclude/ǥ쥯ȥ˥ԡƲ

(2) DocumentRootγΥǥ쥯ȥѤΥեĺäƤΥѥ򲾤ˡ/home/yourhome/xoops/ Ȥޤ

(3) Υեβ fullcache Ȥǥ쥯ȥhttpdؤν¤ͿƤʰŪˤϡchmod 777

(4) mainfile.php򳫤ơXOOPS_URLԤľˡ
[code]
	define('XOOPS_TRUST_PATH','/home/yourhome/xoops');
[/code]
ȰɲäƤ/home/yourhome/xoopsʬŬ񤭴Ƥ

(5) mainfile.php  common.php ƤӽФʬifʸγ¦ˤˡɲäޤEMLHƤʤ顢θˤޤProtectorƤʤ顢precheckɹǤ
[code]
	require XOOPS_ROOT_PATH.'/include/fastestcache.php' ;
[/code]

(6) mainfile.php  common.php ƤӽФʬľifʸ¦ˤˡɲäޤifʸ¦Ǥ뤳ȤդƤProtectorpostcheckȤʤޤ
[code]
	if (!isset($xoopsOption['nocommon']) ... ) {
		include XOOPS_ROOT_PATH."/include/common.php";
		fastestcache_setcookie() ; // ιԤ
	}
[/code]

(7) include/functions.php Խơؿredirect_header()κǽʬ˰ʲΤ褦ˣɵޤ
[code]
function redirect_header($url, $time = 3, $message = '', $addredirect = true)
{
    fastestcache_clearcache() ; // ιԤɲ

    global $xoopsConfig, $xoopsRequestUri, $xoopsLogger, $xoopsUserIsAdmin;
[/code]

ʾ塢ȤƤϤʤĹʤޤXOOPSΥС󥢥åפˤä˲ǽΤϡinclude/functions.php ɵʬȻפޤС󥢥åפ˲줿顢(7)ΣԤäƤ



ư

HackϴŪˡϥե륿ѤƤޤϥե륿νʬǡXOOPS_TRUST_PATH/fullcache/ ʲˡڡޤ뤴ȤΥå¸櫓Ǥ

ڡζ̤ϡREQUEST_URI١ǤꡢΥƱREQUEST_URI褿顢å夫ǡɤ߽Фƽλޤξ硢ۤȤɤΥ⥸塼Ǥϥǡ١³餢ޤΤǡˤƹ®˽λޤF5å򤫤Ƥ⡢ФΥ᡼ϤۤȤɤʤȸ٥Ǥ

󡢥桼㤨СɽƤΤǡȤǤϤʤ桼ˤĤƤϡåID˥å̤Ƥޤ

Υå夬ŪʤΤϡƤΤƤȿǤʤȤåͭredirect_header() ؿHackǲ褷Ƥ롢ȤǤ

ۤȤɤΥ⥸塼ϡƤʤɤνԤäϡredirect_header() ƤǤޤĤޤꡢredirect_header()ƤФ줿ǡΥ桼λĥå򤹤٤ƥꥢСƤ¨¤ȿǤ櫓Ǥ

ΥåǤκϡ¿HackȤη͹礤ǤƱREQUEST_URIǤʤ顢åACCEPT_CHARSETʤɤˤäƽѤʤƤϤʤΤϡʤΥܥȥͥåȤʤäƤޤޤä񤷤ΤHTTP쥹ݥ󥹥إåˤcharsetǤ

ΤˡEMLH¦ǤбɬפȤʤäƤޤޤ®åϥåȡEMLHʻѤϡEMLH1.23ʾ˾夲Ƥmainfile.phpǤν֤פǡ褬EMLHǡθ˺®åϥåǤ뤳ȤդƤProtectorϤˤθ


ʤߤˡFCHΥҥåΨϡPEAK XOOPSʿ20%Ǥͭȸ뤫ɤ̯ʤȤǤ®⡢դΤʤϢ³ɤơ٤Ū˶ü礭ʤ뤳Ȥ򤱤롢Ȥˤ̣ꤽǤ

ޤƥĤۤ¿ʤȤǤСåΥҥåΨ⤦夬ΤȴԤޤ


ȡȤˤĤƤϡåIDۤʤäƤƤƱΥåȤưäƤ뤿ᡢȥƥĤ˥åIDޤ륱Ǥ꤬ޤFCHǡsession.use_trans_sid offˤƤޤŪ˥åIDURIȤƽ񤭽Ф⥸塼ǽȤƹͤΤǡΥ⥸塼ѤƤˤϡΥϥåŬѤ٤ǤϤޤ󡣰դΤʤåϥåǽޤʰ0.20ǡȤΤʤ褦ʥե륿򤫤褦ˤޤġ


TODO

⥸塼뵡ǽ



ѹ

2006-06-30 0.26
- HTMLʸ񤫤ɤȽǴν (thx suin)

2006-06-27 0.25
- $_SERVER['REQUEST_URI'] δĶؤб (cronˤɤ߽Фʤ)

2006-02-23 0.24
- 桼Ͽ(register.php)ϥå夷ʤ褦˻ѹ

2006-02-19 0.23
- 󡦥ȤߤΥХν (thx biroron)
- ̤äݤURI򸫤Ĥǡå夷ʤ褦˻ѹ

2006-02-13 0.22
- ⥸塼Τˤϡֽ٤URIɽפɲá

2006-01-29 0.21
- 桼ϿʤʤäƤԶν (thx harasaki)

2006-01-03 0.20
- ܤʥѤΥå֤ȥ桼ѤΥåʬΥʤɡ
- ƥ˥å󸰤ĤäƤ¸ʤ褦ˤ
- ȿǤ줺Ⱦ֤Τޤޤ˸Хν

2005-12-30 0.11
- ѸΥɥȤ񤤤
- ǥХåѤΥɤĤäƤΤ

2005-12-29 0.10
- FastestCacheHack ¸ǤȤƤΥ꡼


                    by GIJOE    http://www.peak.ne.jp/xoops/


[/xlang:ja]
