- 2008-12-11 (木) 23:48
- Wordpress
どーもムダブログの表示が遅いので、なんとかしようと「WP-Cache」プラグインを導入。
Wordpressは表示が遅いとよく言われます。
アクセスがある度にページを動的生成する仕組みのためしょうがないところ。
エントリーが増えてきたらそれはそれでアドバンテージがあるんですが。
MovableTypeとか標準は静的ファイルで表示する半面、再構築が結構手間ですからね。
…と、前置きはこれぐらいにして導入メモ。
そのまま有効にすると「Ktai Style」と競合します。
なので少し作業が必要。
まず「WP-Cache」からダウンロード。
解凍したら中にある「wp-cache-config-sample.php」を「wp-cache-config.php」にリネームしてコピー。
<?php
/*
WP-Cache Config Sample File
See wp-cache.php for author details.
*/
$cache_enabled = false; //Added by WP-Cache Manager
$cache_max_time = 3600; //in seconds
//$use_flock = true; // Set it tru or false if you know what to use
$cache_path = ABSPATH . 'wp-content/cache/';
$file_prefix = 'wp-cache-';
// Array of files that have 'wp-' but should still be cached
$cache_acceptable_files = array( 'wp-atom.php', 'wp-comments-popup.php', 'wp-commentsrss2.php', 'wp-links-opml.php', 'wp-locations.php', 'wp-rdf.php', 'wp-rss.php', 'wp-rss2.php');
$cache_rejected_uri = array('wp-');
$cache_rejected_user_agent = array ( 0 => 'bot', 1 => 'ia_archive', 2 => 'slurp', 3 => 'crawl', 4 => 'spider');
if (file_exists(ABSPATH. 'wp-content/plugins/ktai_style/patch-wpcache.php')) {
include ABSPATH. 'wp-content/plugins/ktai_style/patch-wpcache.php';
}
// Just modify it if you have conflicts with semaphores
$sem_id = 5419;
if ( '/' != substr($cache_path, -1)) {
$cache_path .= '/';
}
?>
20行目のところに3行追加。
つまり、$cache_rejected_user_agentのところの下に
if (file_exists(ABSPATH. 'wp-content/plugins/ktai_style/patch-wpcache.php')) {
include ABSPATH. 'wp-content/plugins/ktai_style/patch-wpcache.php';
}
を追加。
で、その「wp-cache-config.php」をwp-contentフォルダ直下においてプラグインを有効にする。
以上です。
一度キャッシュされると多少は体感速度変わる…かな
とりあえず使ってみます![[パンチ]](http://blog.nakatta.net/wp-content/plugins/ktai-style/pics/SA/punch.gif)
関連記事:
Comments:0
Trackbacks:0
- Trackback URL for this entry
- http://blog.nakatta.net/archives/2008/12/post_333.html/trackback
- Listed below are links to weblogs that reference
- WP-Cacheプラグイン導入 from Nakatta blog