ËÙ¶ÈÓÅ»¯Ö®GZIP-¶ÔjscssѹËõ
ÆäʵºÜ¼òµ¥ÔÀí¾ÍÊÇͨ¹ýGZipѹËõjsÒÔ¼°css£¬È»ºó´«Èëµ½ä¯ÀÀÆ÷½âѹ£¬ÔÙÏÔʾµÄ¹ý³Ì£¬Ò»°ãѹËõÁ˵Ļá±ÈÔÏȵÄС70%×óÓÒ¡£
µÚÒ»²½,ͨ¹ý»ðºüÁ˽âgzipµÄѹËõ£¬¾ÍÊÇÈÃÄã¿´¿´ËûÊDz»ÊÇÖ§³Ögzip½âѹ¡£Èçͼ

µÚ¶þ²½£¬ÔõôÓÃphpʵÏÖcssÒÔ¼°jsµÄѹËõÄØ£¿ÈçÏ´úÂë
<?php /** *@a.header(...ÕâÒ»ÐÐÊÇÉèÖÃѹËõÎļþÀàÐ͵Ä,Èç¹ûÄãҪѹËõjsÎļþ¾Í½«text/css¸Ä³Étext/javascript *@b.include(...´Ë´¦°üº¬ÄãҪѹËõµÄÎļþ,¶à¸ö°´ÄãÏÖÔÚµÄ˳ÐòÒÀ´ÎÓÃinclude("...");µ÷Óà */ if(extension_loaded('zlib')){//¼ì²é·þÎñÆ÷ÊÇ·ñ¿ªÆôÁËzlibÍØÕ¹ ob_start('ob_gzhandler'); } header ("content-type: text/css; charset: utf-8");//ÔÚÕâÀïÉèÖÃҪѹËõµÄÎļþÀàÐÍ header ("cache-control: must-revalidate"); $offset = 60 * 60 * 240;//ÎļþµÄ¾àÀëÏÖÔڵĹýÆÚʱ¼ä£¬ÕâÀïÉèÖÃΪһÌì $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT"; header ($expire); ob_start("compress"); function compress($buffer) {//È¥³ýÎļþÖеÄ×¢ÊÍ $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); return $buffer; } include("style.css");//ÔÚ´Ë´¦°üº¬ÄãËùҪѹËõµÄÎļþ,¶à¸öÇëÓÃinclude°üº¬ºóÒÀ´ÎÅÅÁÐ if(extension_loaded("zlib")){ ob_end_flush();//Êä³öbufferÖеÄÄÚÈÝ } ?>µÚÈý²½£¬ÊµÏÖjsÒÔ¼°cssµÄµ÷Ó㬴úÂëÈçÏÂ
ÀýÈçÔÏȵÄcss£º
<link rel="stylesheet" media="screen" href="http://mrthink.net/wp-content/themes/zsofa/style.css"> µ÷ÓÃgzipµÄcss£º <link rel="stylesheet" media="screen" href="http://mrthink.net/wp-content/themes/zsofa/css.php?v=100415"> jsµÄ´úÂëÐèҪעÒâÔÚÉÏÃæContent-typeÐÞ¸Äheader ("content-type: text/css; charset: utf-8");³ÉΪheader ("content-type:application/x-javascript; charset: utf-8"); jsµ÷ÓôúÂëÐÞ¸ÄΪ£ºscript type="text/javascript" src="/uploads/201102/201102221298335999_0.jpg.thumb.jpg" id="aimg_28" border="0" />
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ