ใครอ่านไม่รู้เรื่องข้ามไปข้างล่างสุดเลยครับ 555+

MySQL Query Cache
Since WordPress uses MySQL, almost every page load results in various MySQL queries for logins, post content, categories and so on. It is very likely that this data didn’t change since the last request so we begin with enabling the cache within the MySQL server. Basically, all you need to to is to activate it in the my.cnf (or my.ini) MySQL configuration file with setting the query-cache-type variable to 1. The query-cache-size variable is the size of the query cache in MB, for example 20M. To change the MySQL configuration file, you’ll probably need root access which won’t be available on shared hosts. More info about query cache is available on techiecorner.com and the MySQL Performance blog.
PHP Compiler Cache
WordPress is a PHP application so every request results in a call from the webserver (like Apache) to the PHP interpreter. This program reads the script files and compiles them into opcode which can be executed. This process may need some time, depending on the size of your script. A PHP Compiler cache saves the script in the compiled state in the memory which allows the PHP engine to execute it directly without compiling again which makes the execution about three times faster. Wide known PHP compiler caches are APC and eAccelerator. Please refer to their websites on how to install them, you will also need root access for that.
WordPress Internal Caching
In case of a slow database server, it might be a good idea to store frequently used data in a serialized form on disk. WordPress has an integrated disk-cache which stores rarely changing data like categories and users in a special folder. Note that this cache is not recommended if the disk is slow or your host (like DreamHost) set up a NFS based storage solution which would request the cached data from a remote storage server. To enable WordPress’s internal caching, uncomment or add this to your wp-config.php: define( ‘ENABLE_CACHE’, true ); and make sure that the wp-content/cache folder is writable!
Static Pages
If all the other caching methods are not enough or you can’t apply them, there is a last solution: Caching the complete generated pages. This can be done via an excellent plugin called WP-Cache. The plugin will cache the whole generated page on the disk and skip the complete WordPress execution on further requests. After a specified time or if you publish a new post, the cache will be cleared and generated once again. This method is the fastest available, but it will break some functionality like plugins which add dynamic content to your blog or count page impressions since they are executed only once. Note: If you want to use this plugin and the PHP Compiler Cache APC together, have a look at this posting from Mark Jaquith.
And of course…
WordPress 2.1
Yes, update to WordPress 2.1 if you haven’t done it yet. This release contains a lot of performance improvements, especially if you are using the MySQL Query Cache. If you’re not running any incompatible plugins, go ahead and upgrade! From the blog post: “Much more efficient database code, faster than previous versions. Domas Mituzas from MySQL went over all our queries with a fine-toothed comb.”
Disable unused plugins
Open your plugin management page and check if you really need all installed plugins. Did you in install some of them just for testing purposes or is their functionality already included in the latest WordPress version? Deactivate them to speed up PHP parsing and processing time.
Optimize your theme
Other hints like reducing HTTP requests, compression and so on can be found on the blog of Paul Stamatiou.
———————————————————————
เอาล่ะ หลังจากนั่งเดาตั้งนาน เรามาเริ่มแปลเลยดีกว่าครับ ^^
MySQL Query Cache เนื่องจาก Wordpress ใช้ MySQL เป็น database ในการเรียกหน้าเว็บเพจ ดังนั้นถ้าหาก blog ของเราป๊อบมากๆ ตัว MySQL ก็อาจจะรองรับไม่ไหว เค้าเลยแนะนำให้ไปแก้ config ของ MySQL (my.cfg หรือ my.ini ให้มีตัวแปร query_cache_type=1) ให้มีการใช้งาน cache การแก้ไข config ของ MySQL นี้ต้องใช้สิทธิ์เป็น root หรือว่า admin ของ server สำหรับผู้เช่าใช้งาน web hosting คงหมดสิทธิ์ครับงานนี้ ก็คงต้องรู้ไว้เป็นข้อมูลอย่างเดียว
PHP Compile Cache. Wordpress เป็น PHP application ตัวหนึ่ง ดังนั้นทุกครั้งที่มีการเรียกหน้าเว็บ ก็จะต้องเรียกใช้ PHP interpreter ทุกครั้ง (โดย Apache web server) ถ้าเราใช้ PHP Compiler cache เข้ามาช่วยเก็บบาง process ที่เรียกใช้บ่อยๆ โดยไม่ต้อง compile ใหม่ทุกครั้ง ก็จะเพิ่มความเร็วของ blog ได้ โดยเราต้องติดตั้ง tool เช่น APC และ eAccelerator เข้าช่วย แต่ … ก็อย่างว่าครับ งานนี้ต้องเป็นเจ้าของ server เองจึงจะทำได้ครับ -*-
Wordpress Internal Caching. มาถึงหัวข้อที่เราพอจะทำได้บ้าง ด้วยการใช้ cache ที่มากับ Wordpress เอง เป็นการสั่งให้ Wordpress เก็บหน้าเว็บที่มีการเรียกใช้งานบ่อยๆ ไว้ใน harddisk ครับ ซึ่งสิ่งที่เราต้องทำก็คือ เพิ่ม define( ‘ENABLE_CACHE’, true ); ใน wp-config.php และ สร้าง directory wp-content/cache แล้วเปิดสิทธิ์ให้สามารถเขียน file (664) ลงไปได้
Static Pages. ใช้ plugin WP-Cache เข้ามาช่วยครับ WP-Cache จะสร้าง static page ไว้ใน harddisk โดยไปสั่งให้ Wordpress ไม่ต้องเรียก PHP interpretation เลย ข้อดีก็คือ วิธีนี้จะช่วยเพิ่มความเร็วได้มากที่สุด แต่ข้อเสียคือ ทำให้เราเสียความลูกเล่นบางอย่างใน blog ไป เช่น dynamic content หรือพวก current page impression, counter เป็นต้น
ซึ่งตัว plugin WP-Cache ผมใช้อยู่ครับ โดยสามารถไปดาวน์โหลดและดูรายละเอียดเพิ่มเติมที่
http://mnm.uib.es/gallir/wp-cache-2/ 
สุดท้ายเขาฝากบอกว่า Wordpress 2.1 นี่ปรับปรุงด้าน performance ขี้นมาก ดังนั้นสมควรจะ upgrade ซะ แล้วถ้ามี Plugin อันไหนที่ไม่ใช่ก็เอาออกเสียบ้าง รวมทั้งพิจารณา theme ที่ใช้ ว่ามันทำให้ blog ของเราช้า อืดอาดหรือไม่
ซึ่งเทมเพจตัวที่ผมใช้อยู่นี้ กินความเร็วมากๆเลยครับ แต่ก็ยอม 555+
———————————————-
แถมให้ครับ เทคนิคการเพิ่มความเร็วของผมนะครับ ^^
ไม่มีอะไรมากครับ ทุกคนที่ใช้ wordpress จะสั่งได้ว่า เทมเพจของทุกคนในส่วนของ header.php จะมีพวกคำสั่งในส่วนของ title และ พวก style sheet แปลก ๆ ซึ่งที่ทุกคนเห็นนั้นแหละครับ มันเป็นคำสั่งที่ต้องเข้าไปคิวรี่ฐานข้อมูลก่อน เพื่อแสดงผลออกมา
ทั้งนี้ ถ้าเราอยากให้มันไม่ต้องไปเสียเวลาคิวรี่ข้อมูลก็ลองทำตามผมนะครับ
<meta http-equiv=”Content-Type” content=”<?php bloginfo(’html_type’); ?>; charset=<?php bloginfo(’charset’); ?>” />
<title><?php bloginfo(’name’); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
<link rel=”stylesheet” href=”<?php bloginfo(’stylesheet_url’); ?>” type=”text/css” media=”screen” />
<link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(’name’); ?> RSS Feed” href=”<?php bloginfo(’rss2_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(’pingback_url’); ?>” />
ก็ลองให้แก้เป็น ….
<meta http-equiv=”content-language” content=”th” />
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″ />
<title>เรื่องเล่าของฉัน | iDatabase Blog l บันทึกออนไลน์ของคนทำเว็บ ปี 1</title>
<link rel=”stylesheet” href=”http://www.idatabaseblog.com/wp-content/themes/idatabase/style.css” type=”text/css” media=”screen” />
<link rel=”alternate” type=”application/rss+xml” title=”iDatabase Blog l บันทึกออนไลน์ของคนทำเว็บ ปี 1 RSS Feed” href=”http://www.idatabaseblog.com/index.php/feed” />
<link rel=”pingback” href=”http://www.idatabaseblog.com/xmlrpc.php” />
จบแ้ล้วครับพี่้น้อง หวังว่าบทความนี้ จะเป็นประโยชน์ต่อชาวโลกมากมายนะครับ 55+
นำมาจาก
http://www.idatabaseblog.com/i...php/2008/10/10/speed-wordpress 
ครับ