1¡¢È«Ò³Ãae¾²Ì¬»¯»º´ae
Ò²¾ÍÊǽ«Ò³ÃaeÈ«²¿Éu³Éhtml¾²Ì¬Ò³Ãae£¬Óû§ÃÎÊʱֱ½ÓÃÎʵľ²Ì¬Ò³Ãae£¬¶ø²»»aÈ¥×ßphpþÎñÆ÷½aÎoµÄÁ÷³Ì¡£´ËÖֽʽ£¬ÔÚCMSϵͳÖбȽϳ£¼u£¬±ÈÈçdedecms£»
Ò»ÖֱȽϳ£ÓõÄʵÏÖ*½Ê½ÊÇÓÃÊa³o»º´ae£º
Ob_start()
**ÒªÔËÐеĴuÂe***
$content = Ob_get_contents();
**½«»º´aeÄÚÈÝдÈehtmlÎļþ***
Ob_end_clean();
2¡¢Ò³Ãae²¿*Ö»º´ae
¸ÃÖֽʽ£¬Êǽ«Ò»¸oÒ³ÃaeÖв»¾³£±aµÄ²¿Ö½øÐо²Ì¬»º´ae£¬¶ø¾³£±a»¯µÄ¿e²»»º´ae£¬×iºo×e×°ÔÚÒ»ÆðÏÔʾ£»¿ÉÒÔʹÓÃÀaËÆÓÚob_get_contents µÄ½Ê½ÊµÏÖ£¬Ò²¿ÉÒÔÀuÓÃÀaËÆESIÖ®ÀaµÄÒ³ÃaeƬ¶Î»º´ae²ßÂÔ£¬Ê¹ÆaÓÃÀ´×o¶¯Ì¬Ò³ÃaeÖÐÏa¶Ô¾²Ì¬µÄƬ¶Î²¿ÖµÄ»º´ae(ESI¼¼Êo£¬Çebaidu£¬´Ë´¦²»Ïe½²)¡£
¸ÃÖֽʽ¿ÉÒÔÓÃÓÚÈçÉ̳ÇÖеÄÉÌÆÒ³£»
3¡¢Êý¾Ý»º´ae
¹ËÃu˼Òa£¬¾ÍÊÇ»º´aeÊý¾ÝµÄÒ»Öֽʽ£»±ÈÈ磬É̳ÇÖеÄij¸oÉÌÆÐÅÏ¢£¬µ±ÓÃÉÌÆidÈ¥ÇeÇoʱ£¬¾Í»aµÃ³o°uÀ¨µeÆÌÐÅÏ¢¡¢ÉÌÆÐÅÏ¢µÈÊý¾Ý£¬´Ëʱ¾Í¿ÉÒÔ½«ÕaÐ(C) Êý¾Ý»º´aeµ½Ò»¸ophpÎļþÖУ¬ÎļþÃu°uº¬ÉÌÆidÀ´½¨Ò»¸oΨһ±eʾ£»ÏÂÒ»´ÎÓÐÈËÏe²e¿´Õa¸oÉÌÆʱ£¬Ê×ÏȾÍÖ±½Óµ÷Õa¸oÎļþÀiÃaeµÄÐÅÏ¢£¬¶ø²»ÓÃÔÙÈ¥Êý¾Ý¿a²e ѯ£»Æaʵ»º´aeÎļþÖлº´aeµÄ¾ÍÊÇÒ»¸ophpÊý×eÖ®Àa£»
EcmallÉ̳ÇϵͳÀiÃae¾ÍÓÃÁËÕaÖÖ*½Ê½£»
4¡¢²eѯ»º´ae
ÆaʵÕa¸uÊý¾Ý»º´aeÊÇÒ»¸o˼Â*£¬¾ÍÊǸu¾Ý²eѯÓi¾aÀ´»º´ae£»½«²eѯµÃµ½µÄÊý¾Ý»º´aeÔÚÒ»¸oÎļþÖУ¬Ï´ÎÓoµ½ÏaͬµÄ²eѯʱ£¬¾ÍÖ±½ÓÏÈ´ÓÕa¸oÎļþÀiÃaeµ÷Êý¾Ý£¬²»»aÔÙÈ¥²eÊý¾Ý¿a£»µ«´Ë´¦µÄ»º´aeÎļþÃu¿ÉÄܾÍÐeÒªÒÔ²eѯÓi¾aΪ»uµaÀ´½¨Á¢Î¨Ò»±eʾ£»
°´Ê±¼a±a¸u½øÐлº´ae
Æaʵ£¬ÕaÒ»Ìo²»ÊÇÕaeÕýµÄ»º´ae½Ê½£»ÉÏÃaeµÄ2¡¢3¡¢4µÄ»º´ae¼¼ÊoÒ»°a¶¼Óõ½ÁËʱ¼a±a¸uÅжϣ»¾ÍÊǶÔÓÚ»º´aeÎļþÄuÐeÒªÉeÒ»¸oÓÐЧʱ¼a£¬ÔÚÕa¸oÓÐЧʱ¼a ÄÚ£¬ÏaͬµÄÃÎʲŻaÏÈÈ¡»º´aeÎļþµÄÄÚÈÝ£¬µ«Êdz¬¹ýÉe¶¨µÄ»º´aeʱ¼a£¬¾ÍÐeÒªÖØдÓÊý¾Ý¿aÖлñÈ¡Êý¾Ý£¬²¢Éu²u×iеĻº´aeÎļþ£»±ÈÈ磬ÎÒ½«ÎÒÃÇÉ̳ǵÄÊ×Ò³¾ÍÊÇÉe ÖÃ2¸oСʱ¸uÐÂÒ»´Î£»
5¡¢°´ÄÚÈݱa¸u½øÐлº´ae
Õa¸oÒ²²¢*ǶÀÁ¢µÄ»º´ae¼¼Êo£¬Ðe½aºÏ×ÅÓ㻾ÍÊǵ±Êý¾Ý¿aÄÚÈݱ»ÐÞ¸Äʱ£¬¼´¿Ì¸uлº´aeÎļþ£»
±ÈÈ磬һ¸oÈËÁ÷Á¿ºÜ´oµÄÉ̳ǣ¬ÉÌƺܶa£¬ÉÌƱi±ØÈ»±È½Ï´o£¬Õa±iµÄѹÁ¦Ò²±È½ÏÖØ£»ÎÒÃǾͿÉÒÔ¶ÔÉÌÆ*ÏÔʾҳ½øÐÐÒ³Ãae»º´ae£»
µ±É̼ÒÔÚºǫÐÞ¸ÄÕa¸oÉÌƵÄÐÅϢʱ£¬µa»÷±£´ae£¬ÎÒÃÇͬʱ¾Í¸uлº´aeÎļþ£»ÄÇô£¬Âo¼ÒÃÎÊÕa¸oÉÌÆÐÅϢʱ£¬Êµ¼ÊÉÏÃÎʵÄÊÇÒ»¸o¾²Ì¬Ò³Ãae£¬¶ø²»ÐeÒªÔÙÈ¥*ÃÎÊÊý¾Ý¿a£»
ÊÔÏe£¬Èç¹u¶ÔÉÌÆÒ³²»»º´ae£¬ÄÇôÿ´ÎÃÎÊÒ»¸oÉÌƾÍҪȥÊý¾Ý¿a²eÒ»´Î£¬Èç¹uÓÐ10ÍoÈËÔÚÏßa¯ÀÀÉÌÆ£¬ÄÇ*þÎñÆ÷ѹÁ¦¾Í´oÁË£»
6¡¢ÄÚ´aeʽ»º´ae
Ìaµ½Õa¸o£¬¿ÉÄÜ´o¼ÒÏeµ½µÄÊ×ÏȾÍÊÇMemcached£»memcachedÊǸßÐÔÄܵÄÖ²¼Ê½ÄÚ´ae»º´aeþÎñÆ÷¡£ Ò»°aµÄʹÓÃÄ¿µÄÊÇ£¬Í¨¹ý»º´aeÊý¾Ý¿a²eѯ½a¹u£¬¼oÉÙÊý¾Ý¿a*ÃÎÊ´ÎÊý£¬ÒÔÌa¸ß¶¯Ì¬WebÓ¦ÓõÄËٶȡ¢ Ìa¸ß¿ÉÀ(C)Õ¹ÐÔ¡£
Ëu¾ÍÊǽ«ÐeÒª»º´aeµÄÐÅÏ¢£¬»º´aeµ½ÏµÍ³ÄÚ´aeÖУ¬ÐeÒª»ñÈ¡ÐÅϢʱ£¬Ö±½Óµ½ÄÚ´aeÖÐÈ¡£»±È½Ï³£ÓõĽʽ¾ÍÊÇ key¨C>value½Ê½£»
<?php
$memcachehost = '192.168.6.191';
$memcacheport = 11211;
$memcachelife = 60;
$memcache = new Memcache;
$memcache->connect($memcachehost,$memcacheport) or die ("Could not connect");
$memcache->set('key','»º´aeµÄÄÚÈÝ');
$get = $memcache->get($key); //»ñÈ¡ÐÅÏ¢
?>
7¡¢apache»º´aeÄ£¿e
apache°²×°ÍeÒÔºo£¬ÊDz»ÔÊÐi±»cacheµÄ¡£Èç¹uÍa½ÓÁËcache»osquid*þÎñÆ÷ÒªÇo½øÐÐweb¼ÓËٵĻ°£¬¾ÍÐeÒªÔÚhtttpd.confÀi½øÐÐÉeÖ㬵±È»Ç°ÌaÊÇÔÚ°²×°apacheµÄʱºoÒª¼¤»imod_cacheµÄÄ£¿e¡£
°²×°apacheʱ£º./configure ¨Cenable-cache ¨Cenable-disk-cache ¨Cenable-mem-cache
8¡¢php APC»º´aeÀ(C)Õ¹
PhpÓÐÒ»¸oAPC»º´aeÀ(C)Õ¹£¬windowsÏÂÃaeΪphp_apc.dll£¬ÐeÒªÏȼÓÔØÕa¸oÄ£¿e£¬È»ºoÊÇÔÚphp.iniÀiÃae½øÐÐÅaÖãº
extension=php_apc.dll
apc.rfc1867 = on
upload_max_filesize = 100M
post_max_size = 100M
apc.max_file_size = 200M
upload_max_filesize = 1000M
post_max_size = 1000M
max_execution_time = 600 ; ÿ¸oPHPÒ³ÃaeÔËÐеÄ×i´oʱ¼aÖµ(Ãe)£¬Ä¬ÈÏ30Ãe
max_input_time = 600 ; ÿ¸oPHPÒ³Ãae½ÓÊÕÊý¾ÝËuÐeµÄ×i´oʱ¼a£¬Ä¬ÈÏ60
memory_limit = 128M ; ÿ¸oPHPÒ³ÃaeËu³ÔµoµÄ×i´oÄÚ´ae£¬Ä¬ÈÏ8M
9¡¢Opcode»º´ae
ÎÒÃÇÖªµÀ£¬phpµÄÖ´ÐÐÁ÷³Ì¿ÉÒÔÓÃÏÂͼÀ´Õ¹Ê¾£º
Ê×ÏÈphp´uÂe±»½aÎoΪTokens£¬È»ºoÔÙ±aÒeΪOpcodeÂe£¬×iºoÖ´ÐÐOpcodeÂe£¬*µ»Ø½a¹u£»ËuÒÔ£¬¶ÔÓÚÏaͬµÄphpÎļþ£¬µÚÒ»´ÎÔËÐÐʱ ¿ÉÒÔ»º´aeÆaOpcodeÂe£¬Ï´ÎÔÙÖ´ÐÐÕa¸oÒ³Ãaeʱ£¬Ö±½Ó»aÈ¥ÕÒµ½»º´aeϵÄopcodeÂe£¬Ö±½ÓÖ´ÐÐ×iºoÒ»²½£¬¶ø²»ÔÙÐeÒªÖмaµÄ²½ÖeÁË¡£