附學啦網的設置教程,不過網站已經打不開了。。幸好我保存了:0 W/ x( e( X4 X+ P
9 S$ t; r. G, N: l) u! f8 U, ^: T
相信很多人下載之後不太會設置這款非常好用的wordpress緩存插件,這次就給大家介紹下這款插件的設置方法,也是經過實踐的結果。史上最全的w3 total cache設置教程。我配置選項如下:
4 U) T: T" o6 m; t
: P" a+ D+ U. l. j* IGeneral Settings0 i" i, R4 d. e. A. K; @1 {
. \: r2 n8 B$ n3 p& k* G, |( G1 I! C1 v( [
Page Cache設置Page cache – 勾選啟用.9 ~; a* V0 @" u+ {' J, f% F
Page cache method – 一般選擇 「Disk: Enhanced」如果VPS memcache緩存開啟的話,選擇memcache應該是不錯的。
( z, i& M# X# G9 R
9 k) ]' h, H O$ V" {Minify設置
- m9 j! C2 [8 D
$ ]* e% `$ Q4 Z2 Z0 C5 u o
1 S6 ?* D8 c g7 J
Minify – 勾選啟用。
2 e; s6 p& D! [, n7 v* J+ y+ c- @- vMinify mode – 選擇「Manual」模式。
& z0 R/ N) w: O% R& B& c/ l; fMinify cache method – 選擇「xcache」緩存方式,如果你的VPS支持APC、memcache、xcache等PHP緩存加速器,那麼你可以嘗試選擇這些加速器。/ z( J1 i; |9 _" Z/ k4 F
HTML minifier – 選擇「Default」。& j$ D% _$ I5 m Z0 J6 M; E
JS minifier – 選擇「JSMin (default)」
* |$ u- q0 \5 n" I+ w/ y' g, h& bCSS minifier – 選擇「Default」8 Q, m7 L$ F- c# X. {" Z4 q
" ?$ X7 Z0 f. t/ \1 q
Database Cache設置, B8 `8 P) a& x7 e, f% B+ ]* E4 U
/ J; {# X/ b8 E# s3 @
8 S* i: C; Z: J+ S! U' }. `Database Cache – 勾選啟用。
0 z8 [+ H% m. l. ^+ p F6 oDatabase Cache Method – 選擇適合你的PHP加速器,這裡我選擇「XCache」。0 Y& s; N( ?( G
' z, [# l* x- t* n" W dObject Cache設置+ C, q3 K8 z& ?* O+ L
; t0 ~. C( N* p- q8 d
$ ]) O( D* R5 W! CObject Cache – 勾選啟用。
1 q8 {; q6 j6 m X! d, L9 J& CObject Cache Method – 選擇適合你的一種加速器模式,同上,這裡選「XCache」。
( D& {( |1 A! [# T' |0 v, D2 C5 s% ^4 C. L, M% z4 s
Browser Cache設置9 t: T1 M e! C6 ^: a9 m1 c: }
% ^& d& m1 X& N2 J
Browser Cache – 勾選啟用。
/ b0 n( [" `4 d, r' |CDN – 略過,不用設置。
+ ?, @; z, _# L; FReverse Proxy – 略過,不用設置。2 B# x: H% h( X
Monitoring – 略過,不用設置。
; y$ a# o; d2 W1 k$ j8 C3 V8 B8 ^$ kLicensing – 略過,不用設置。
$ c) @# b* g8 f2 h# U$ ?0 k4 d7 Tmiscellaneous – 略過,不用設置。; g+ E& M6 U8 b8 Z
Debug – 略過,不用設置。只需在開啟緩存加速器時測試時開啟使用。5 [1 m2 F/ _. [" q- d1 M W O) ?; q
Import / Export Settings – 參數設置導入及導出功能。! i! v+ Z" _1 R4 t* Y
8 M. V9 O1 ~0 s
) L3 M8 t2 ~" b: `, hAdvanced Settings – Page Cache設置
% G2 T; T8 g/ W |9 _2 Z9 @3 O
/ z" L7 Q2 s, X
1 m5 _5 j& U! c
General- v0 a& g0 H5 ]4 R! N1 g# K& B# T4 J
Cache front page – 勾選開啟
# k! s7 {% ~: R7 wCache feeds – 勾選開啟, j& \* D" S# K2 p }( s
Cache SSL (https) requests – 不勾選(如果你的網站使用SSL可以勾選開啟)
/ b" x4 Y4 U( X, ^& @" D7 h0 dCache URIs with query string variables – 勾選開啟" U8 x8 ?8 l7 h
Cache 404 (not found) pages – 不勾選
" E7 D. H4 w8 iCache requests only for site address – 勾選開啟
8 i" Z1 Q- t7 a# B* H+ a( Y" }Don』t cache pages for logged in users – 勾選開啟
4 }/ B7 m" j; T% yDon』t cache pages for following user roles – 不勾選
$ E' g. ]2 p, J7 F. _ U: u o) C: i. {# u6 e" c
Cache Preload
0 s' \& Q3 t9 s# A5 @Automatically prime the page cache – 勾選開啟
, F; l6 L1 @) r5 z: ]& pUpdate interval – 輸入 10004 }, P1 G; d0 `0 w8 h! F$ E( Z1 d
Pages per interval – 輸入 15
6 J: U( f. R1 V! NSitemap URL – 輸入網站地圖路徑(/sitemap.xml)" U% B" X8 u0 @: w' K3 W
Preload the post cache upon publish events. – 勾選開啟( U& \! x* ~5 f6 |$ |
% ]# g3 \% g; z& F. Z7 U% nPurge Policy: Page Cache- h; |' m8 k1 l1 O6 U8 V: \
Specify the pages and feeds to purge when posts are created, edited, or comments posted – 勾選開啟( Front Page, Posts, page, Post page, Blog feed)% Y- X" e i! v5 I4 q8 M0 s& i
Specify the feed types to purge – 勾選開啟 rss2 (default). z# o* _2 [" U6 Y u7 X7 K
Purge Limit: 輸入 158 _ c9 l" Y& }
Additional pages: 略過不設置5 @" p/ h3 x* R/ D; I# L3 x
Purge sitemaps:略過不設置
' ^: d& Z% A+ F2 x" }& g
: m* N8 h9 _, a- S9 aAdvanced
; V, N+ j% T( g9 C: H: kLate initialization:勾選開啟+ P7 ~3 a6 \# b
其餘所有選項默認。% i. ]" T( y* c K
8 Y4 T: a3 M. x( A9 X
Advanced Settings – Minify設置
: l" B$ ?6 X; a% ?
( l4 p. Y( R7 M- \: D: k! X; `) s5 z( b& U3 Y3 \
General/ \+ i) i' o! W% [
Rewrite URL structure – 不勾選
& h4 R6 D+ e' ?! i0 wDisable minify for logged in users – 不勾選; @* d6 \4 V3 c; U; t2 n# }$ g
Minify error notification:不開啟 (Disabled )
2 U3 ^7 J. y4 p: ?; yHTML & XMLHTML minify settings - 如果可能啟用(如果可用盡量開啟,由於我開啟後測試發現模板有問題,此選項及以下選項均未開啟。)2 G$ Q9 m2 U+ L0 D
Inline CSS minification –取消選中
' n7 [/ V8 ]5 h; YInline JS minification – 取消選中- b7 s7 a' l' x" M0 v; i
Don』t minify feeds – 取消選中! M1 M7 s# L& m
Line Break Removal – 取消選中: l M8 ^2 h* O# X# {/ D1 c' s4 W
JSJS minify settings – 勾選啟用(啟用此選項需要密切關注網頁是否有錯位及其它不兼容現象發生); X$ ?5 X& f* m; P( e
Operations in areas – 全部選擇 Minify, 和 Embed Type 「Default (blocking」。
2 ]" S# n9 }3 h- A. f" G5 i: }" _$ c8 XPreserved comment removal –選中開啟9 V+ h2 O- v2 a. U- j j( P$ M
Line break removal – 選中開啟(由於開啟此項我網站網頁出現問題,遂未開啟此項)
4 X$ l# i0 [" {, p3 XCSSCSS minify settings – 選中開啟(開啟此項也需密切關注網頁是否有問題發生)
% [9 t. e( I2 g5 C- _Combine only – 取消選中
6 O% v5 b+ Q* [7 }Preserved comment removal (not applied when combine only is active) –勾選開啟# ?1 { }- E7 _" |/ k
Line break removal (not applied when combine only is active) – 勾選開啟
: W3 x8 U9 G6 j4 j! ^@import handling – 選擇 「None」# v: p0 i8 Q: l$ a* R+ t- ?9 b0 o
AdvancedUpdate external files every:輸入 21600: d; ?( I; a" f8 W, H0 Z4 P% k
Garbage collection interval – 輸入86400
0 S0 \% c; {" d5 m3 n( @$ B餘下選項全部留空並保留默認。
; \3 V! `) G' Y2 C* m- }* l7 V7 G& S
( a" B7 D& W8 [1 _0 JAdvanced Settings – Database Cache設置
# t8 b9 @) m& v8 ?4 y( \
% x6 w; G( X; ?0 ?) Q q. b( B
) I7 m; ?6 c v
GeneralDon』t cache queries for logged in users – 勾選啟用
! P( K+ Z& M4 m$ |+ m8 T( o' OAdvancedMaximum lifetime of cache objects – 輸入 180 seconds$ m, A6 {: N: |- {# q1 [
Garbage collection interval – 輸入 3600 seconds4 K! f# F( |% Z) L" y0 F
Never cache the following pages – 留空+ B) J5 W2 b$ n1 w
Ignored query stems – 保留默認
* Z6 a# J+ i4 E vReject query words – 保留默認. |% t+ I/ ]3 z0 G$ q0 P8 d2 N
0 o7 p& E0 W2 Y' J, H% H; K
Advanced Settings – Object Cache+ v6 t1 q2 P+ c' Y8 X
) s( J* h: N/ N/ Y
$ W: r0 E% ~3 n v% HAdvanced- l5 F- h u. K3 X* i9 O; O
Default lifetime of cache objects – 輸入 180 seconds
9 f7 g {7 ^6 v% G J x3 n" oGarbage collection interval – 輸入 3600 seconds(如果是磁盤存儲模式)
: v8 B" N9 f) F: O8 ^Global groups –保留默認
* P4 M5 `6 t% M/ {* R/ L! ENon-persistent groups –保留默認& p4 X1 U5 W5 H8 X
3 B- e: i+ I" V/ H# ^' k% ~- AAdvanced Settings – Browser Cache設置1 |4 B; ~; _1 s- |7 p0 B% T3 |
5 A. O7 f. A7 e r" R" O$ p0 J
" ?2 x+ n9 T' b: Z0 Y vGeneralSet Last-Modified header – 勾選啟用
0 D* p) [- X/ ?, @4 S' C) ^Set expires header – 勾選啟用% [5 a' a- d S* D( _3 Q) A
Set cache control header – 勾選啟用0 x3 p# ]: w8 Q% @! Z% ]- i; `
Set entity tag (eTag) – 勾選啟用
& D: a) N5 `& N0 j+ K& F" }- }Set W3 Total Cache header – 勾選啟用
2 v% n9 x( \# f9 nEnable HTTP (gzip) compression – 勾選啟用0 {8 w0 Z) o6 l7 p7 o8 b: S
Prevent caching of objects after settings change – 留空
5 r* I5 F0 v1 I5 s) D7 YPrevent caching exception list – 留空* D, g; P. G( c/ U1 V( H; U# k, z
Disable cookies for static files – 留空
9 O1 B' l4 v( M1 c+ o( }* U$ gDo not process 404 errors for static objects with WordPress – 留空
# Z: \1 K& y3 M: i404 error exception list – 保留默認值* u2 o/ l& h8 L0 l0 ]8 e
CSS & JSSet Last-Modified header – 勾選啟用
5 \" ] S- J7 G2 w" pSet expires header – 勾選啟用
1 A9 d" g& f) A5 CExpires header lifetime – 輸入 31536000 seconds5 i( ? c) z6 u* r
Set cache control header – 勾選啟用
1 L% G. }( \& z6 C2 i6 S# NCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECNDS」): B4 m' B! X/ j
Set entity tag (eTag) – 勾選啟用2 T- {+ I. J; i2 v5 k' t
Set W3 Total Cache header – 勾選啟用4 k5 l: Y/ h7 y: z
Enable HTTP (gzip) compression – 勾選啟用
( o1 S/ |5 T+ [Prevent caching of objects after settings change – 留空- g" C" H6 G) c) r L
Disable cookies for static files – 留空
7 ^+ u: F/ K7 M( n( y$ @4 C4 i" @HTML & XMLSet Last-Modified header – 勾選啟用! |4 b4 w& K# J4 k* G6 ~- V( S
Set expires header – 勾選啟用
3 l' B+ b8 P% x- d8 D+ p: qExpires header lifetime – 輸入 3200 seconds5 U' T3 d- a# v2 \" O+ O5 K
Set cache control header – 勾選啟用
& s4 i+ Q R1 | J3 Z) r; c( N, k9 UCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)1 w4 b- T; y2 S1 b, {1 Z, D
Set entity tag (eTag) – 勾選啟用; ?8 C2 ~" G' c/ s
Set W3 Total Cache header – 勾選啟用, M' q% @" E, F5 {5 [
Enable HTTP (gzip) compression – 勾選啟用1 y) j; C: n, q' G3 K, C
Media & Other FilesSet Last-Modified header – 勾選啟用
$ {1 P3 I+ o0 G1 ?! N, TSet expires header – 勾選啟用# W, A" h4 O( M
Expires header lifetime – 輸入 31536000 seconds
+ o+ e8 _9 O' ?$ D6 i; u+ lSet cache control header – 勾選啟用
- `' p# S8 v" n* x7 `$ iCache Control policy – 選擇 「cache with max-age (「public, max-age=EXPIRES_SECONDS」)
* R/ a4 n. s5 CSet entity tag (eTag) – 勾選啟用
4 z( ~; }1 E F ?: H$ {! WSet W3 Total Cache header – 勾選啟用
2 ~2 M# V* l- f7 `. nEnable HTTP (gzip) compression – 勾選啟用1 @4 h7 \+ N% ~3 g: T
Prevent caching of objects after settings change – 不勾選
& p+ l8 o' d: tDisable cookies for static files – 不勾選
7 M( |! h8 t9 f. h6 i$ P1 H其餘選項如果用不到全都不用設置。7 Z2 ]2 T% j) m$ e0 l5 |8 N
4 }* H, y. t3 U) e. [' Z9 ]. t) s
# m" W. d- \+ b6 g. ]( f. C4 s$ t+ o7 N
|