附學啦網的設置教程,不過網站已經打不開了。。幸好我保存了:+ m1 J9 n, K8 {2 `- U- @5 L7 @
" ^" Z+ R4 V" G1 |( ~/ H0 F
相信很多人下載之後不太會設置這款非常好用的wordpress緩存插件,這次就給大家介紹下這款插件的設置方法,也是經過實踐的結果。史上最全的w3 total cache設置教程。我配置選項如下:
, b4 t) ~0 L! y j2 j
1 U- h: z9 V" X/ GGeneral Settings8 g: g5 R& v; u1 h A: w/ d2 R/ ^
9 g4 s6 E" Y: ^0 M- _, D. f
9 z% N' s2 o0 W1 T) |Page Cache設置Page cache – 勾選啟用.
9 Z- K) E2 V5 y: S( i) RPage cache method – 一般選擇 「Disk: Enhanced」如果VPS memcache緩存開啟的話,選擇memcache應該是不錯的。* s9 S1 e- s6 i4 D; O2 S
5 J0 T2 Z' g7 [% _/ `
Minify設置
4 ]1 x+ y* ^7 u3 ?2 L0 |1 l
3 |/ H+ C" v& v7 i4 b# C
8 e4 ?' B9 Z8 t6 A7 ]! c4 G. ]Minify – 勾選啟用。, U: X" i8 f& h% E5 _8 F
Minify mode – 選擇「Manual」模式。5 {8 a5 t8 U) l
Minify cache method – 選擇「xcache」緩存方式,如果你的VPS支持APC、memcache、xcache等PHP緩存加速器,那麼你可以嘗試選擇這些加速器。
1 ~% b! H3 _: J; Z- X) kHTML minifier – 選擇「Default」。
" W$ w# d# C/ p& Q/ v7 iJS minifier – 選擇「JSMin (default)」$ \9 p$ z7 F5 |6 V
CSS minifier – 選擇「Default」5 N' Z" _* _7 [; h+ y% X* T0 m
1 V+ [+ L$ }3 M, E2 l4 e: hDatabase Cache設置/ h( N+ t- {8 g4 ?2 D! g
9 ~) i( _, q. _' u; l# s
7 k9 }/ d' ]1 K) B- f! L( x. ^( D: ^
Database Cache – 勾選啟用。& B) E1 X) Z6 F
Database Cache Method – 選擇適合你的PHP加速器,這裡我選擇「XCache」。' P0 U* f* p3 K3 U* ]; y! A) i5 Y
0 p0 g/ Y. @" M% d8 K+ l
Object Cache設置/ ]% ?! o% y0 P
3 T: H) C* k+ S* y$ @! H5 i* o7 N2 j3 W. J3 ?& e
Object Cache – 勾選啟用。
* q# I' S$ W- `Object Cache Method – 選擇適合你的一種加速器模式,同上,這裡選「XCache」。
2 j% {+ `0 }6 L" U8 x; u, ~$ S3 l9 o* M; O
Browser Cache設置+ ~/ `' H/ W/ `- R1 |
9 o& _1 ^* F# ?) C# j
Browser Cache – 勾選啟用。) a9 n. r1 I% y% n, o) {! z# j }
CDN – 略過,不用設置。
( ~$ c3 t. c" \& vReverse Proxy – 略過,不用設置。1 t2 C$ W/ f' s) t- H2 N+ F
Monitoring – 略過,不用設置。6 ^; D8 a" ~6 F9 [; J) u- J
Licensing – 略過,不用設置。8 I* O1 h/ K& y2 n, I! A/ W8 U" h
miscellaneous – 略過,不用設置。
; _( I+ r3 E+ ^ Q6 ZDebug – 略過,不用設置。只需在開啟緩存加速器時測試時開啟使用。
+ @- W; x" V4 w9 o: BImport / Export Settings – 參數設置導入及導出功能。
9 t, ~$ k ^6 ^" V& C5 }$ x [" @' d4 [( i
% \0 F8 `) q3 X% r! O! B) vAdvanced Settings – Page Cache設置$ O( B' P! l- y. O/ P
5 x/ I+ y9 o1 _3 X
' o% P2 S0 p: M3 U* a; `% b3 ?& @General
0 V8 ?/ R0 z- {. R* [7 VCache front page – 勾選開啟1 L( {3 L) _5 g
Cache feeds – 勾選開啟
8 {* _: M1 X QCache SSL (https) requests – 不勾選(如果你的網站使用SSL可以勾選開啟)
( I$ d! M# v: _: O4 f2 u1 R) PCache URIs with query string variables – 勾選開啟
5 d4 V9 P/ F; R# a; T2 LCache 404 (not found) pages – 不勾選
' V& G5 ^$ H3 E% S9 uCache requests only for site address – 勾選開啟6 S/ W& H0 z" w; n- ]; b# h2 H
Don』t cache pages for logged in users – 勾選開啟, [& w% ]. X7 w6 m. ^4 e9 @
Don』t cache pages for following user roles – 不勾選
% `* h# q9 e5 R& m
( j! l4 V4 x( L# SCache Preload* d1 l* f/ @7 _: R5 H
Automatically prime the page cache – 勾選開啟" ^, w) k$ R; f9 n0 X
Update interval – 輸入 1000
/ T4 k3 [8 f5 A9 u/ s" K( }Pages per interval – 輸入 15. a8 B/ r6 J( g$ e; z" m( e
Sitemap URL – 輸入網站地圖路徑(/sitemap.xml)
r; f5 g* D) ]9 {# M( LPreload the post cache upon publish events. – 勾選開啟8 V" Q) o, U& B# L ]0 @" `
5 E4 s$ J/ v3 V$ N6 R1 vPurge Policy: Page Cache& ]. y* o6 C0 R7 t5 C1 g" N8 ^
Specify the pages and feeds to purge when posts are created, edited, or comments posted – 勾選開啟( Front Page, Posts, page, Post page, Blog feed)5 @7 w# M& W: \. E0 Y* \3 A
Specify the feed types to purge – 勾選開啟 rss2 (default)) U" y2 L- e, k8 t9 y v9 x
Purge Limit: 輸入 15
. Y3 p* l# F! A- X9 H7 u1 K$ x0 sAdditional pages: 略過不設置
/ a6 {9 X8 K" f7 [1 E6 a1 C& PPurge sitemaps:略過不設置. _! e* n$ v9 f- @% Q
+ Q! U2 {4 ` X6 L5 H7 v
Advanced
d3 L% q% ?% G$ vLate initialization:勾選開啟
) u) S2 L+ u9 P) r. v其餘所有選項默認。
}* |; u2 G) U& V% |3 h
# s5 r+ O/ d; E" k8 rAdvanced Settings – Minify設置
! A8 I3 `( c, l! k/ O7 j
; o6 z" O. u# j- R
; G6 i/ {: f" f! a; X$ }8 v" x A0 e6 C# ~General
0 p3 ]* J- J- }: R" r' |Rewrite URL structure – 不勾選
- W: V1 n/ s7 z# y4 f% tDisable minify for logged in users – 不勾選
, d4 @; r6 c& d% \/ t2 l" ZMinify error notification:不開啟 (Disabled )4 H9 Q$ V: o% k$ O5 F, x
HTML & XMLHTML minify settings - 如果可能啟用(如果可用盡量開啟,由於我開啟後測試發現模板有問題,此選項及以下選項均未開啟。)
) k" U1 @& }! X% W0 \Inline CSS minification –取消選中5 |" X2 W* X0 d
Inline JS minification – 取消選中! z: E% R$ K* L1 @
Don』t minify feeds – 取消選中
: R. f! Z/ I* `, W& oLine Break Removal – 取消選中
" d: m% {' M4 @1 ~# I5 s$ n9 U# Z lJSJS minify settings – 勾選啟用(啟用此選項需要密切關注網頁是否有錯位及其它不兼容現象發生) ]1 P' S5 S* h
Operations in areas – 全部選擇 Minify, 和 Embed Type 「Default (blocking」。
) v' `- W3 G+ x a7 ?& fPreserved comment removal –選中開啟
3 o* c* ^/ Q$ u5 e; C9 n1 ZLine break removal – 選中開啟(由於開啟此項我網站網頁出現問題,遂未開啟此項)
8 [7 O( i. k! j3 oCSSCSS minify settings – 選中開啟(開啟此項也需密切關注網頁是否有問題發生)) _- m% j) {/ m6 }8 q3 \
Combine only – 取消選中
; c, W. o- g; GPreserved comment removal (not applied when combine only is active) –勾選開啟" S6 s0 z P. E9 r2 u" B d, }" R! M
Line break removal (not applied when combine only is active) – 勾選開啟! g! z" z/ F9 E/ H0 p- x9 a
@import handling – 選擇 「None」" L: \; ~# `) l+ |6 U$ \) k, U4 s* h
AdvancedUpdate external files every:輸入 21600
2 z& ]8 j d( ?8 a3 U1 }7 n, SGarbage collection interval – 輸入86400* ?( B' ^ b9 D6 X" z5 o# L& V
餘下選項全部留空並保留默認。
' n" e- @: z8 c) _5 ?* V. t: r+ n& ^4 u! K/ [5 y {+ h0 e6 _
Advanced Settings – Database Cache設置4 m- a3 \% J+ S$ m) e/ X
9 F" f3 p$ q7 ?; F( W+ U8 `3 X
6 q" K% ^" c8 ?+ Y" pGeneralDon』t cache queries for logged in users – 勾選啟用
7 e! E; l2 W. P6 JAdvancedMaximum lifetime of cache objects – 輸入 180 seconds; z9 J' J* K6 i/ I
Garbage collection interval – 輸入 3600 seconds" `6 C+ C" x8 A6 f$ d5 I5 f0 R" P. C
Never cache the following pages – 留空2 ?# R6 c3 A& o1 u0 Q1 R- `7 w) d: c
Ignored query stems – 保留默認# k( |, x* ~$ G' Z
Reject query words – 保留默認! e# _; B( f) }; E
( W0 h4 ^6 g2 i/ y3 j9 D
Advanced Settings – Object Cache% S1 W8 p* S0 ^2 J- @/ f
9 e6 l! R) L& D+ u
% j$ i! w' C8 S5 V5 J
Advanced3 }, h# k# O0 ~% M* J5 N
Default lifetime of cache objects – 輸入 180 seconds
, r; c1 V1 \# \ ?' b# x6 FGarbage collection interval – 輸入 3600 seconds(如果是磁盤存儲模式)! o. R l% _+ f" }8 R* ]& j
Global groups –保留默認
8 o% E/ t* y$ @Non-persistent groups –保留默認
: f3 `" a, m2 l- w& Q- H. R3 G
8 T! n. m Z2 W5 j) MAdvanced Settings – Browser Cache設置
# ?( y/ ]5 W# d) i9 M
- B5 s# ^' {- @+ s
& N7 B' f5 P/ p: ^8 B8 @9 FGeneralSet Last-Modified header – 勾選啟用* e4 T* L9 d g4 Z. Z
Set expires header – 勾選啟用# C$ ~- I. ]5 |6 k% l. x% \
Set cache control header – 勾選啟用9 r0 w/ r! `; P9 C: i0 J
Set entity tag (eTag) – 勾選啟用+ [9 `4 ~. ?! @+ x' f
Set W3 Total Cache header – 勾選啟用- w' \+ }. Y! u" S
Enable HTTP (gzip) compression – 勾選啟用
7 u% G# s8 s' E" B& qPrevent caching of objects after settings change – 留空
( i# o9 \, W! r0 g7 I. }# MPrevent caching exception list – 留空
9 l! ^% R1 ~9 C) a! b- d3 gDisable cookies for static files – 留空
' {0 y# x7 ]6 Y, f- XDo not process 404 errors for static objects with WordPress – 留空! I- _1 v* ]8 K b) s! Y' \
404 error exception list – 保留默認值" A4 H ]) y, [
CSS & JSSet Last-Modified header – 勾選啟用4 M& U9 g) E9 O* Y6 \ j
Set expires header – 勾選啟用9 p4 _' j) e2 ^0 E- A: w
Expires header lifetime – 輸入 31536000 seconds
( y2 Z3 i; `5 G$ ^( m |Set cache control header – 勾選啟用
3 `% c0 F% \7 `; WCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECNDS」)
2 y; G# G2 T" l2 f3 h, HSet entity tag (eTag) – 勾選啟用
. u4 E4 j: X/ m5 @8 V" g. aSet W3 Total Cache header – 勾選啟用
/ u8 D* _8 a- X7 Z5 dEnable HTTP (gzip) compression – 勾選啟用
/ x1 K" L& h% O1 }Prevent caching of objects after settings change – 留空
4 c! o5 Z5 ?! U, o" @7 X4 BDisable cookies for static files – 留空
X: Y: Z x2 r! z9 a# gHTML & XMLSet Last-Modified header – 勾選啟用* s1 }# e) ]* v5 M6 \ d; J: g
Set expires header – 勾選啟用
2 o* I% U: S: x# DExpires header lifetime – 輸入 3200 seconds
: V/ n. E, L' A; N0 [! j* tSet cache control header – 勾選啟用
. D) J( d: K; I0 \( FCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)
& t2 l( o& g4 _3 OSet entity tag (eTag) – 勾選啟用# {( J1 k$ x x9 E, m& U2 g6 x r
Set W3 Total Cache header – 勾選啟用
# |% ?3 A z9 O. c4 W% O' s1 hEnable HTTP (gzip) compression – 勾選啟用3 m! c( s. Z7 n( F _
Media & Other FilesSet Last-Modified header – 勾選啟用
* f) \+ s, N3 ~3 s1 n/ @Set expires header – 勾選啟用4 I0 ^) n1 M, l: P& f8 [; c3 |3 {
Expires header lifetime – 輸入 31536000 seconds
, ^: q% b; X7 n* W4 e: WSet cache control header – 勾選啟用
& _* ~: u% P dCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)4 `* |/ b& K# {5 X( e/ M( G4 ]
Set entity tag (eTag) – 勾選啟用' l x/ }2 C4 K* l& N& e _1 H
Set W3 Total Cache header – 勾選啟用
& G5 D9 Y, i) y% W3 ]1 Q5 r& r* SEnable HTTP (gzip) compression – 勾選啟用
, r% m5 d1 {) ]5 m2 v0 O9 d+ BPrevent caching of objects after settings change – 不勾選
9 P5 l, G. l% \Disable cookies for static files – 不勾選
7 r) [0 h$ `% o w" I F/ W其餘選項如果用不到全都不用設置。1 h1 J- _0 Q, L$ V
: i; ]8 F# H# Y
5 L% r0 g* U; Q G% L% [
|