附學啦網的設置教程,不過網站已經打不開了。。幸好我保存了:# R. k# z B5 _' K
: C4 t- q0 N; @+ u) ?( {4 l相信很多人下載之後不太會設置這款非常好用的wordpress緩存插件,這次就給大家介紹下這款插件的設置方法,也是經過實踐的結果。史上最全的w3 total cache設置教程。我配置選項如下:, G8 G+ q/ l6 }4 g2 G) ? g# Y
7 Z# g, Y+ _* U" ?, `General Settings
, S! S) ~6 w6 _9 }. ^
+ R$ I. G9 z! ^# ?2 Z- i
3 A% m, i) d# Y- p# t$ `. CPage Cache設置Page cache – 勾選啟用.
" g b( A$ N5 a" bPage cache method – 一般選擇 「Disk: Enhanced」如果VPS memcache緩存開啟的話,選擇memcache應該是不錯的。 a' p) C9 P* B- c0 `% U' s
% y4 D F. O/ ]5 |7 U) _
Minify設置
7 ]$ O8 j8 ~3 ~
1 n) d+ {$ N9 r" X) O
( J8 W' E8 D6 V' @ lMinify – 勾選啟用。
* o( w" k$ i* mMinify mode – 選擇「Manual」模式。5 A9 E; a: w. s" a4 @
Minify cache method – 選擇「xcache」緩存方式,如果你的VPS支持APC、memcache、xcache等PHP緩存加速器,那麼你可以嘗試選擇這些加速器。) }2 Y3 @6 G9 C& B- O/ L
HTML minifier – 選擇「Default」。+ {) X8 ~) I* ?4 X6 {+ q
JS minifier – 選擇「JSMin (default)」( F: N9 O( t# n$ j* y* {6 u, [
CSS minifier – 選擇「Default」5 C$ J/ S8 x( R1 K6 ~
. ?% R8 K* C8 |, |Database Cache設置! D' w3 S- b; E- N8 `7 v
" w; F8 ?( }+ e4 B% l
0 N/ s4 z# U/ h$ C' YDatabase Cache – 勾選啟用。
# |* W) }: w/ T" ?% T9 @: VDatabase Cache Method – 選擇適合你的PHP加速器,這裡我選擇「XCache」。
; R- T9 @7 e+ D' @
; }' }3 ]) k3 |& w( nObject Cache設置9 l0 g: a. N6 l4 D2 S( ]: W3 f% M5 z
$ f, t" L6 r- T$ R Z, d! z, ?
k, E1 I8 S: X* B& D! `1 MObject Cache – 勾選啟用。4 }' Y9 w& k- W4 j6 m8 x
Object Cache Method – 選擇適合你的一種加速器模式,同上,這裡選「XCache」。
( X# d. [% V7 s' f8 `4 O0 y B9 n
Browser Cache設置
+ ], t+ b5 [' R8 a9 ~! h* Q
1 l* P1 r4 H# d+ R8 ?8 tBrowser Cache – 勾選啟用。8 D0 z8 l# A$ C: T; K! `
CDN – 略過,不用設置。
4 j) J- b1 d! [2 ?2 G6 |$ iReverse Proxy – 略過,不用設置。
% O/ S( R& K% MMonitoring – 略過,不用設置。% c6 N6 \2 [. s
Licensing – 略過,不用設置。3 `8 G! }# h1 s7 G& S
miscellaneous – 略過,不用設置。& s0 V z7 U6 `* \1 j9 K1 m2 p
Debug – 略過,不用設置。只需在開啟緩存加速器時測試時開啟使用。
3 Z% E/ n: C5 oImport / Export Settings – 參數設置導入及導出功能。! o: @$ B0 J. {/ ^' J6 [8 d
% | ~! o4 J" U, g/ a
' f- t, L% [5 ]# G- `( R C0 pAdvanced Settings – Page Cache設置
) L% Q7 `8 l8 |% r% E; E
+ [& H0 ` X9 b# G0 Y% e" L' l9 a: v J% q# c7 B9 d, e
General" {) H2 V' Z, _# e0 J- H
Cache front page – 勾選開啟
5 w" P }6 o6 m/ h+ w. _ |0 ACache feeds – 勾選開啟, C, l( k* `3 f0 g: z, \8 }
Cache SSL (https) requests – 不勾選(如果你的網站使用SSL可以勾選開啟)
# c, ]- y( z! z( j4 {; }Cache URIs with query string variables – 勾選開啟
# L! r" X$ o; N+ V# t; O+ SCache 404 (not found) pages – 不勾選5 j6 p9 |0 X2 p, ~2 ]
Cache requests only for site address – 勾選開啟
7 p: \9 b( c, X7 K; kDon』t cache pages for logged in users – 勾選開啟
; ? m3 M3 V! y! `, j G9 gDon』t cache pages for following user roles – 不勾選 g' Y" c* M: F
8 t. ?% u0 _; I7 wCache Preload3 S$ Z5 P2 x' }7 K( u$ L
Automatically prime the page cache – 勾選開啟
5 _( x) h. ~. A# R2 E& XUpdate interval – 輸入 1000
, ?1 p. ?% h! hPages per interval – 輸入 15
# D: i/ l1 ?& E5 u. L& HSitemap URL – 輸入網站地圖路徑(/sitemap.xml)
5 i: s8 M" V- z2 b9 nPreload the post cache upon publish events. – 勾選開啟
0 i' j% s6 z# R- i: h" I" R P+ b& C& v, x! Y" c
Purge Policy: Page Cache) H: i( {5 |6 n8 e$ h$ f, S
Specify the pages and feeds to purge when posts are created, edited, or comments posted – 勾選開啟( Front Page, Posts, page, Post page, Blog feed)" o2 b6 w) A( B9 ]3 }3 H
Specify the feed types to purge – 勾選開啟 rss2 (default)
# O4 ~8 ^$ z% w6 Q {3 O4 h; GPurge Limit: 輸入 150 p$ {) a. H6 _0 j* q. }' [
Additional pages: 略過不設置* {( I$ `9 G. R0 o* V; s# m
Purge sitemaps:略過不設置! r( n' a6 L; V+ O
6 [/ \0 i' E$ x' d6 _Advanced
% ]4 O: \+ {; O6 @0 e' X" W) jLate initialization:勾選開啟3 }3 G: z/ ?- r% `3 o- E
其餘所有選項默認。) v3 Z1 e D. C2 X
3 @5 C$ i: h D" K! PAdvanced Settings – Minify設置
# v# u0 k% y6 _& ~
8 M, d; }; S& r! N; w
) }, w9 `8 q$ Z+ N$ d: F
General2 R. a+ r2 V% V; Q8 m3 b
Rewrite URL structure – 不勾選
8 p4 H, A+ J+ g6 }) d" Q! oDisable minify for logged in users – 不勾選
3 T2 l& }+ r. a( t! CMinify error notification:不開啟 (Disabled ) J$ u# J& E: V: y! S E6 u
HTML & XMLHTML minify settings - 如果可能啟用(如果可用盡量開啟,由於我開啟後測試發現模板有問題,此選項及以下選項均未開啟。)3 T" j% }, W- n+ K: }
Inline CSS minification –取消選中
8 U, ^( s9 P& NInline JS minification – 取消選中
- s' T# B1 o* l. h5 [Don』t minify feeds – 取消選中5 T0 Z' x/ K$ O
Line Break Removal – 取消選中: b* l+ ?1 }7 \; w" e/ X) _
JSJS minify settings – 勾選啟用(啟用此選項需要密切關注網頁是否有錯位及其它不兼容現象發生)
6 E& ]' ^% r" v! O. mOperations in areas – 全部選擇 Minify, 和 Embed Type 「Default (blocking」。
0 k, l6 a4 ~' q! GPreserved comment removal –選中開啟2 c$ k% W+ E2 i; Q* ^
Line break removal – 選中開啟(由於開啟此項我網站網頁出現問題,遂未開啟此項)
) ^4 d$ h7 O" a7 c& S0 p( UCSSCSS minify settings – 選中開啟(開啟此項也需密切關注網頁是否有問題發生)
* ]5 j- E2 \# x7 Q4 HCombine only – 取消選中7 W$ t/ K2 i9 V! y1 Z( B+ ]4 v
Preserved comment removal (not applied when combine only is active) –勾選開啟
! R( S+ s7 P3 e" C$ pLine break removal (not applied when combine only is active) – 勾選開啟
$ k5 `# N& }. k8 F; ~@import handling – 選擇 「None」3 x: d0 w9 `, ?8 a
AdvancedUpdate external files every:輸入 21600
4 r: L* d" R5 N! n. h2 N$ ~1 SGarbage collection interval – 輸入86400) S$ P5 v$ H( y0 N
餘下選項全部留空並保留默認。- r2 Y) j- L$ x/ m
* T# r- m5 D, Y6 n F* b8 `Advanced Settings – Database Cache設置
9 F% ^1 i" `$ y( G; b4 U0 a
' K+ x. f3 l. U' X( j+ m3 U5 ?2 p8 g- S C& ]
GeneralDon』t cache queries for logged in users – 勾選啟用
. l0 J0 \$ I- E- d+ [AdvancedMaximum lifetime of cache objects – 輸入 180 seconds
) a% l2 c; Z; C7 x! r1 e: lGarbage collection interval – 輸入 3600 seconds
6 Z! t2 V- Q zNever cache the following pages – 留空0 d- j/ j- c$ |
Ignored query stems – 保留默認
( R, f4 d! i+ q6 R; V% H1 FReject query words – 保留默認
6 f* n% [3 A9 s) e3 P" d% y; f' m! c6 O
Advanced Settings – Object Cache6 }' ~3 |( r+ F( S3 p) r3 G
3 l* y" t) S0 D8 c ?) W3 K* w# p3 C5 |7 p/ S* D6 B
Advanced
$ U* X3 I S, D+ @' {Default lifetime of cache objects – 輸入 180 seconds
$ l" {% I0 f& l; r' NGarbage collection interval – 輸入 3600 seconds(如果是磁盤存儲模式)0 v9 ]+ k0 s# B; I- e/ t* W
Global groups –保留默認1 x2 k s% s- h5 T4 T7 J5 e- c
Non-persistent groups –保留默認* w2 v a4 a7 j, B# \& G1 m
* c; |- s, `7 v5 k( H2 g& x, E
Advanced Settings – Browser Cache設置+ }) i* G, X1 v
& s6 `2 |! C9 |9 w! z; A* p
. T& r$ h0 ^, W1 N$ N. r# vGeneralSet Last-Modified header – 勾選啟用
, c) `) M0 g2 I4 B0 M3 @2 \Set expires header – 勾選啟用
/ F" K! y5 k7 v, E2 I4 X" K) jSet cache control header – 勾選啟用
9 `9 Q2 Q0 K& zSet entity tag (eTag) – 勾選啟用
, a2 A( J9 Q8 o% j' e; }; WSet W3 Total Cache header – 勾選啟用
. f" n/ s6 G$ S5 y6 L& vEnable HTTP (gzip) compression – 勾選啟用# b I' d& A" x
Prevent caching of objects after settings change – 留空7 T) `3 H( h( n. [. x# o- t/ v, U
Prevent caching exception list – 留空
% o4 \- `! [* mDisable cookies for static files – 留空
# v) F i6 ]- Q( m+ ^# I- `Do not process 404 errors for static objects with WordPress – 留空8 q3 ~' p8 X2 o4 ]# C3 _$ f- F
404 error exception list – 保留默認值0 D v3 y# e, y5 N0 M* p
CSS & JSSet Last-Modified header – 勾選啟用
* a# ?# b4 M; P' [Set expires header – 勾選啟用" e6 w& V2 n, L9 V; V9 [
Expires header lifetime – 輸入 31536000 seconds
4 N0 U4 t/ s" Y( y, u) u) CSet cache control header – 勾選啟用3 m% E7 I4 K+ m8 \1 q, c
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECNDS」)# C; ~- n% r" i
Set entity tag (eTag) – 勾選啟用
# n7 A' \* h$ a/ B' y1 xSet W3 Total Cache header – 勾選啟用" i2 Z0 } h8 h3 |+ A0 ^: V
Enable HTTP (gzip) compression – 勾選啟用
3 S3 G' \8 Q! N- PPrevent caching of objects after settings change – 留空
5 H$ m) f5 w8 M1 RDisable cookies for static files – 留空
" T' y9 W. K; V" k, _% u$ lHTML & XMLSet Last-Modified header – 勾選啟用
) D/ Z$ n+ r7 K, tSet expires header – 勾選啟用
1 `* S% J) F! }" M% CExpires header lifetime – 輸入 3200 seconds" `0 V2 X2 @: ^% O. ~
Set cache control header – 勾選啟用- E+ F. _4 u% C2 U5 [& U
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)# V( a' X4 [7 Y
Set entity tag (eTag) – 勾選啟用
' ]& R" Y7 ]. r+ B9 wSet W3 Total Cache header – 勾選啟用
8 }4 w$ W% _- s4 R+ fEnable HTTP (gzip) compression – 勾選啟用! u1 S: G3 e& [/ W
Media & Other FilesSet Last-Modified header – 勾選啟用
% ]( o# c( j" m. B+ R$ s) A0 ASet expires header – 勾選啟用2 ~( b1 |4 ^/ {6 T6 {' L" R1 W
Expires header lifetime – 輸入 31536000 seconds& K' W( Z t5 J" ^4 r- j
Set cache control header – 勾選啟用+ }4 R5 g2 M1 S9 I' ~5 B% F$ ^
Cache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)
( ^1 j: v+ g, O0 t! e4 t" RSet entity tag (eTag) – 勾選啟用
9 n8 A* c4 ~# g; lSet W3 Total Cache header – 勾選啟用
; d" O+ r9 n. C4 DEnable HTTP (gzip) compression – 勾選啟用; q3 l' |4 k& S' [5 ~4 G
Prevent caching of objects after settings change – 不勾選) x! {3 {* z+ j+ y: D
Disable cookies for static files – 不勾選
# n! g; @; b9 Y- F/ T" x. E7 @其餘選項如果用不到全都不用設置。
: T* N* O* w6 D1 f8 ^; b$ H6 U! }1 x+ a# @1 S3 U
. }# n+ L3 ?$ L' a7 @5 t' D- s
|