Saran saya sih lebih baik pake WP-supercache, lebih straightforward dan dampaknya langsung terasa...
pernah pake W3 total-cache di nginx tapi ya... gak tau deh ngefek atau tidak...
Kalau mau coba WP-supercache, install dulu pluginnya, kemudian cachenya di ON-kan, bisa juga setting tab advancenya centang yang ada (recommended) gitu..
Setelah di save, baru tambahkan line ini di konfigurasi /etc/nginx/sites-available/, restart nginx. Kalo pake opcode cache (APC) clear cache juga disana:
Code:
set $cache_uri $request_uri;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $cache_uri 'null cache';
}
if ($query_string != "") {
set $cache_uri 'null cache';
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $cache_uri 'null cache';
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
set $cache_uri 'null cache';
}
location / {
#try_files $uri $uri/ /index.php?q=$request_uri;
# line diatas default nginx, ganti jadi berikut:
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
}
untuk cek working atau gak, bisa liat folder [folder wordpress]/wp-content/cache/supercache/[alamat situs]. kalau ada banyak folder2 permalink situs, tandanya udah working...