附學啦網的設置教程,不過網站已經打不開了。。幸好我保存了:8 p/ {( u5 {9 s. u0 t' [5 F, V: S
! a3 b1 n4 v% R' F# y* s+ S相信很多人下載之後不太會設置這款非常好用的wordpress緩存插件,這次就給大家介紹下這款插件的設置方法,也是經過實踐的結果。史上最全的w3 total cache設置教程。我配置選項如下:1 k+ Y- m/ }7 b, F; N
4 H# u1 s9 }' c
General Settings
6 B1 P, K; _# @$ ^. |# M. B
: n. |. R8 x, e0 e$ N- |" V/ a; c
' V# ~; Z! e6 B6 v0 ?6 c
Page Cache設置Page cache – 勾選啟用. _$ V4 ^. S' j' X! q4 L* D2 h
Page cache method – 一般選擇 「Disk: Enhanced」如果VPS memcache緩存開啟的話,選擇memcache應該是不錯的。1 r, C) K0 H. O1 R: B4 N a
$ N$ t1 ?$ D) X: u) ~8 K5 A) |, f- h; U+ }
Minify設置
1 F; g+ q' ?& w3 m1 R! x% Z, j
8 s- E! h# A& A, x: `4 }: F& s1 A. d6 `
4 i$ p& S4 y1 r D2 E. X2 u3 c8 HMinify – 勾選啟用。9 @) \' j4 l; v6 J/ K$ j" }! V
Minify mode – 選擇「Manual」模式。1 L/ b6 o4 \% R
Minify cache method – 選擇「xcache」緩存方式,如果你的VPS支持APC、memcache、xcache等PHP緩存加速器,那麼你可以嘗試選擇這些加速器。
) y8 B2 d1 z8 ~- j3 jHTML minifier – 選擇「Default」。
2 F- q" N$ v0 p# [JS minifier – 選擇「JSMin (default)」: X+ j* t1 y) t8 U7 z' |( d( |
CSS minifier – 選擇「Default」
L( t6 T0 V3 ^7 d. E) U- F f7 S' f, t& W2 V0 P
Database Cache設置
: E [ {5 s, y
0 _$ J5 j1 O, }/ z- ?' F( b" M6 l8 t" z. W0 N5 j7 m
Database Cache – 勾選啟用。9 G5 f6 v, ` _1 @
Database Cache Method – 選擇適合你的PHP加速器,這裡我選擇「XCache」。5 k- c; T. v, }. I5 d1 X
0 J8 d6 u& Q% a+ n$ bObject Cache設置( }0 D! m" v; p- D
( i2 {8 L2 g; K5 t+ g' I* t
1 Y/ v- ^/ S( r# V" n" k
Object Cache – 勾選啟用。) E2 d* K8 m! m1 c0 c% U
Object Cache Method – 選擇適合你的一種加速器模式,同上,這裡選「XCache」。
/ q& I3 Y/ y* M6 m* J( f
5 Z4 p3 Y5 r( q4 B G+ D# nBrowser Cache設置
; b! h* u& a- r# k+ b
/ r# q/ N* a4 Z, N9 Y4 b, x XBrowser Cache – 勾選啟用。
& E, T8 J- P! u- N. r3 ?( n7 N6 lCDN – 略過,不用設置。0 D0 u6 ?# K# p
Reverse Proxy – 略過,不用設置。
% S9 y# h+ _3 z5 j C. eMonitoring – 略過,不用設置。6 z9 u9 z8 H" b, y) {* M9 @
Licensing – 略過,不用設置。
7 Q7 p3 L! \3 U5 F- xmiscellaneous – 略過,不用設置。# X u- C. @: y( ^
Debug – 略過,不用設置。只需在開啟緩存加速器時測試時開啟使用。2 y& e$ c1 ^. c
Import / Export Settings – 參數設置導入及導出功能。) a t; g2 B5 o* m- G
" i5 `7 j7 F+ s1 l; H R& I, M/ n5 I) A) R5 K [( b/ E
Advanced Settings – Page Cache設置
& }' F4 s4 g2 g- n" Z6 n$ D
; D7 Y- K! C3 w
; {+ m5 p( q9 ^$ HGeneral( W% E( ]+ r- Y
Cache front page – 勾選開啟
' G# t3 W; p# ~! `0 m2 y1 {7 G5 a2 vCache feeds – 勾選開啟
! H/ b& E( n+ m X- ]$ j" gCache SSL (https) requests – 不勾選(如果你的網站使用SSL可以勾選開啟)) ~, F3 ^: H' d' a+ n
Cache URIs with query string variables – 勾選開啟
3 ~1 f+ }/ s; U! {2 H. _( YCache 404 (not found) pages – 不勾選
* [7 T3 O2 }& w A6 H* WCache requests only for site address – 勾選開啟* U% ?5 B0 `. X" G
Don』t cache pages for logged in users – 勾選開啟0 T$ }; {) V' x/ p. p# m2 O
Don』t cache pages for following user roles – 不勾選$ f. }* ]5 R1 b+ \# d
& _: O: Q" X$ O" f4 c
Cache Preload
6 m; \5 G" W. s, w% O6 O3 {. f# mAutomatically prime the page cache – 勾選開啟
2 b" P( X0 U8 Y( l( `, IUpdate interval – 輸入 1000
0 W4 X9 b3 e# z% P8 g7 y! L6 V* [) ]Pages per interval – 輸入 15
6 v& s( ]( Z" RSitemap URL – 輸入網站地圖路徑(/sitemap.xml)
% O7 k4 ]- n. _) R! N$ sPreload the post cache upon publish events. – 勾選開啟8 t/ y- b0 `: G, i+ [: m5 J! @
2 V/ @) s5 `- d3 j+ W9 G6 ]
Purge Policy: Page Cache
- v: i( s: ?$ e; b& y1 aSpecify the pages and feeds to purge when posts are created, edited, or comments posted – 勾選開啟( Front Page, Posts, page, Post page, Blog feed)
4 D' j: [" M0 NSpecify the feed types to purge – 勾選開啟 rss2 (default)
) S' R( c, o8 |7 TPurge Limit: 輸入 15
1 O$ @, b. A6 n4 Q/ A1 ~. `9 B2 q2 _ g: mAdditional pages: 略過不設置
7 x2 T O* ~8 O. g( lPurge sitemaps:略過不設置
V& f4 a# w) o6 {$ k+ h" f6 b. g Z. |& |5 J& q/ C
Advanced/ c3 u" q6 a3 [: [7 j
Late initialization:勾選開啟
8 i1 [( S( I: [, v9 y# q2 b& V其餘所有選項默認。7 J/ X! h- u2 Q' S, z9 r' }+ Z5 ~1 w
+ s& c( ~! r3 N a
Advanced Settings – Minify設置
" U W7 Y9 }& i' E* E+ b
5 V1 B0 L% M1 I, |+ e
' @# n3 `( w. M3 c+ O: G7 _General" `8 Q1 p, t0 H
Rewrite URL structure – 不勾選' c, l# h2 ]9 x T. x m
Disable minify for logged in users – 不勾選
- `8 ?, c i; ^# e/ xMinify error notification:不開啟 (Disabled )
: x; I; ]- Y# x- o) y! W* ]HTML & XMLHTML minify settings - 如果可能啟用(如果可用盡量開啟,由於我開啟後測試發現模板有問題,此選項及以下選項均未開啟。)
, ?5 P: t8 |, G, ] S4 V# ?Inline CSS minification –取消選中
' }) d! @% j! V; ?Inline JS minification – 取消選中* R8 Z7 q% ]6 N% u2 \
Don』t minify feeds – 取消選中
. [0 k( K3 W% G. ~! J! m0 DLine Break Removal – 取消選中
& [: c& y+ J7 D, sJSJS minify settings – 勾選啟用(啟用此選項需要密切關注網頁是否有錯位及其它不兼容現象發生)
( m- k' W0 M5 [& }$ g# y' c8 HOperations in areas – 全部選擇 Minify, 和 Embed Type 「Default (blocking」。' Y. t, v1 r! x0 ?. n7 W9 u
Preserved comment removal –選中開啟- g6 M2 V8 s6 s0 z u! b7 L
Line break removal – 選中開啟(由於開啟此項我網站網頁出現問題,遂未開啟此項)
K! l1 y% @. s* P2 |# lCSSCSS minify settings – 選中開啟(開啟此項也需密切關注網頁是否有問題發生)% \6 o2 p% p3 r3 T5 @" g
Combine only – 取消選中7 Y8 g# |" c+ s/ m: }5 |' Y
Preserved comment removal (not applied when combine only is active) –勾選開啟' Z( o$ o F S$ ]+ b5 i
Line break removal (not applied when combine only is active) – 勾選開啟% I0 s2 o8 x% [( c( {/ n
@import handling – 選擇 「None」
: [% [' V% a3 `( A. SAdvancedUpdate external files every:輸入 21600. J2 O6 ~. C" N1 x) }4 Y& b1 j1 D
Garbage collection interval – 輸入86400
4 b- r8 F6 ]6 H' `7 Q7 j$ F餘下選項全部留空並保留默認。
" w( y3 A% ]3 z, F2 E
7 M) s# M& ]" r' kAdvanced Settings – Database Cache設置5 d* l& Y+ b$ ]6 J# A E% W
* q' k' m: N3 G
6 _0 W1 N7 I* k& AGeneralDon』t cache queries for logged in users – 勾選啟用
$ ^/ Z3 ^2 L: ?* W, R( @: SAdvancedMaximum lifetime of cache objects – 輸入 180 seconds
0 C M# I" i2 i6 [3 n/ _, W2 wGarbage collection interval – 輸入 3600 seconds
) B: r. w% p: Y6 | ~4 r# o& i. wNever cache the following pages – 留空2 W7 s V* O N" d: j1 u" g7 d! y
Ignored query stems – 保留默認# _- J, `2 g$ u/ T4 P2 z8 f
Reject query words – 保留默認
$ N# @. Z0 F- w; P! Z+ \9 J9 l
Advanced Settings – Object Cache
5 g1 D2 T& U9 j4 N- s, j
3 l6 a8 w+ W0 f0 J
5 }5 c& j/ M- V& J% fAdvanced
" r, |! b# W6 t: qDefault lifetime of cache objects – 輸入 180 seconds B! R m- A' P' |2 L2 G
Garbage collection interval – 輸入 3600 seconds(如果是磁盤存儲模式)8 Y$ ~$ r! W# D, N* M9 M C
Global groups –保留默認
: n% q) X9 z/ U. |/ X0 R; SNon-persistent groups –保留默認
0 R; o: [/ l( j+ T: n! ^$ ^; J6 I, h' V1 h8 q# q @$ e4 M
Advanced Settings – Browser Cache設置. |- G. }: r7 w$ J. j7 K) i
4 [ Q A& |; P4 F$ y9 B
$ u& C/ P6 s) K: X# `GeneralSet Last-Modified header – 勾選啟用
: G2 s$ g; Z* X0 t: fSet expires header – 勾選啟用
6 j/ X l, ?- r- PSet cache control header – 勾選啟用
$ z8 m a: v* N+ X/ QSet entity tag (eTag) – 勾選啟用
- \8 i1 r7 [, f% KSet W3 Total Cache header – 勾選啟用) p% {* I( {" b0 D; g" o
Enable HTTP (gzip) compression – 勾選啟用9 Z. u5 A2 N) r! P, Z! K6 I
Prevent caching of objects after settings change – 留空
n& J4 @+ k* h2 j: G. q( D/ ]Prevent caching exception list – 留空
n7 I; Y0 N. p! u! KDisable cookies for static files – 留空
& K7 c& r: I& K U4 qDo not process 404 errors for static objects with WordPress – 留空
" R f* q2 u8 @: s: e1 e404 error exception list – 保留默認值1 N. A( u# k( ^5 k
CSS & JSSet Last-Modified header – 勾選啟用& i0 l0 t: A- M. U% Q4 z+ k
Set expires header – 勾選啟用9 h8 _/ H4 B! J) T& }( c
Expires header lifetime – 輸入 31536000 seconds5 H' P5 s j: J, v+ m+ k" H$ L- N
Set cache control header – 勾選啟用/ r, g k0 e# ?6 s j
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECNDS」)
: T* X. Y) {2 bSet entity tag (eTag) – 勾選啟用( x; i. e6 L7 N8 e
Set W3 Total Cache header – 勾選啟用" m$ Q" Z X1 n, E5 D* F
Enable HTTP (gzip) compression – 勾選啟用
( S2 L" H1 S8 M% {2 }Prevent caching of objects after settings change – 留空. {9 [# Y& \: u: P5 |
Disable cookies for static files – 留空
, a- j% I5 A! }HTML & XMLSet Last-Modified header – 勾選啟用2 P7 A ^) X1 u
Set expires header – 勾選啟用0 ?4 g0 \$ a; H! b; _ o
Expires header lifetime – 輸入 3200 seconds, j0 |' T9 U9 g2 q
Set cache control header – 勾選啟用+ x6 h. M6 m9 R( Z: l/ ]
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)
0 B8 s Y5 Z0 c; i6 v; nSet entity tag (eTag) – 勾選啟用
! o7 X, G: i# }+ `, w% m6 wSet W3 Total Cache header – 勾選啟用& C6 X. r4 r* ?
Enable HTTP (gzip) compression – 勾選啟用
3 V7 V9 }2 z. x+ o# dMedia & Other FilesSet Last-Modified header – 勾選啟用
! K$ y2 X5 {+ ZSet expires header – 勾選啟用8 d7 \" ]+ W* l3 Z
Expires header lifetime – 輸入 31536000 seconds
3 j8 Q1 z; G$ P8 [Set cache control header – 勾選啟用0 J8 f$ V7 t) I2 H
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)
( k& M- ~* L3 V. x+ T# SSet entity tag (eTag) – 勾選啟用
7 b, B5 z1 n; E' cSet W3 Total Cache header – 勾選啟用6 `( h2 a+ P5 w6 o7 R6 N' R
Enable HTTP (gzip) compression – 勾選啟用( W5 z. H- F( W% C6 p
Prevent caching of objects after settings change – 不勾選( L/ r& K) |" X6 K
Disable cookies for static files – 不勾選
) W) b/ V+ v1 d其餘選項如果用不到全都不用設置。
3 v9 s O0 K& w& O3 m" }# R$ g6 P3 D# u2 j5 p* B9 ]5 a
: D, G1 `& A3 }1 s7 M9 N U
|