没有不值得去解决的问题,也没有不值得去学习的技术!

Real-World Performance Comparison Before and After CDN Launch: Fixing WordPress Cache Misjudgments and Verifying Actual Speedup

CDN上线后的boce数据

作者:

在

🧭 I. Background

During the long-term performance optimization of the WordPress site, I gradually introduced the following technical components:

  • W3 Total Cache
  • Redis Object Cache
  • Nginx + OneinStack
  • Cloudflare CDN

The goal of this evaluation:

Build a quantifiable, comparable, and reusable performance evaluation system for WordPress global acceleration.


📚 II. Relevant Historical Baseline Data


📌 1. Baseline Before CDN Deployment

👉 WordPress Theme Performance Comparison: Hueman vs Twenty Twenty-Five (Pre-CDN Baseline)

Provides:

  • WebPageTest data before CDN deployment
  • boce baseline data
  • Original Request Table structure

📌 2. W3TC Cache Misjudgment Correction

👉 Full Troubleshooting Process for WordPress + Nginx + W3 Total Cache Not Taking Effect

Used to explain:

❗ The early conclusion that “Page Cache is not working” was incorrect. The root cause was a misjudgment of the cache state, not a lack of system support.


🧪 III. Anomalies After CDN Deployment

Anomalies appeared during initial testing after the CDN went live:

  • boce average response time increased
  • WebPageTest TTFB rose
  • Some nodes were inaccessible
  • Overall performance degraded

📸 Figure 1: First boce Test After CDN Deployment

Figure 1: First boce test after CDN deployment

📸 Figure 2: WebPageTest Results After CDN Deployment

Figure 2: WebPageTest results after CDN deployment

📸 Figure 3: boce Second Round Test Results

Figure 3: boce second round test results

🧠 IV. Key Turning Point: Trigger for Cache Misjudgment

While analyzing “why the CDN made things slower,” I discovered a key anomaly:

❗ The magnitude of the performance degradation far exceeded the reasonable range of latency added by simply introducing an extra network layer via the CDN.


🔍 After Reviewing Changes, I Found:

  • CDN configuration was normal
  • Nginx was running normally
  • Redis was normal
  • WordPress had not been updated

👉 The only change:

❗ W3 Total Cache Page Cache was disabled


🧪 Re-verification Experiment

After re-enabling Page Cache:

  • CDN remained unchanged
  • Ran boce + WebPageTest tests again

📊 V. WebPageTest

WebPageTest data after CDN deployment
WebPageTest data after CDN deployment

MetricValue
TTFB0.175s
FCP0.907s
LCP1.217s
Speed Index1.787
CLS0.042
TBT0.073s
Requests78
Fully Loaded5.795s
Page Size2MB

📊 VI. Comparison Before vs. After CDN Deployment


🌐 boce Comparison

boce data after CDN deployment
boce data after CDN deployment

ItemBefore CDNAfter CDN
Average response4–5s1–2s
Slowest node10s8–10s
InaccessibleA fewVery few
StabilityMediumSignificantly improved

🌐 WebPageTest Comparison

MetricBefore CDNAfter CDN
TTFB0.668s0.175s
FCP2.053s0.907s
LCP2.261s1.217s
Speed Index2.3531.787
Requests7678

🧠 VII. Request Table Structure Change Analysis

Request Table structure changes

✔ Before CDN Deployment

  • CSS/JS load paths were concentrated
  • Obvious origin fetches for image assets
  • Long blocking chains
  • Slow time to first byte

✔ After CDN Deployment

  • Improved CDN hit rate for static assets
  • Significant drop in time to first byte
  • Optimized resource chains
  • Reduced origin requests

🧠 VIII. WordPress CDN Performance Scoring System


🧮 1. boce Scoring Model (Stability)

MetricWeight
Average response time40%
Slowest node20%
Inaccessible30%
Volatility10%

🧮 boce Scoring Results

StateScore
Before CDN70
After CDN90

⚡ 2. WebPageTest Scoring Model (Performance)

MetricWeight
TTFB30%
FCP20%
LCP20%
Speed Index20%
TBT10%

⚡ WebPageTest Scoring Results

StateScore
Before CDN72
After CDN92

🧱 3. Request Table Scoring Model (Structure)

ItemScore
CDN hit rateImproved
JS blockingReduced
CSS structureOptimized
Image loadingMore distributed

🧱 Structure Score

StateScore
Before CDN68
After CDN88

📊 IX. Comprehensive Scoring Model (Core Conclusion)


🧮 WordPress CDN Comprehensive Score

DimensionWeightBefore CDNAfter CDN
boce stability35%7090
WebPageTest performance40%7292
Request structure25%6888

🎯 Final Scoring Results

StateTotal Score
Before CDN70/100
After CDN90/100

🧠 X. Key Findings


🎯 1. Clear Real-World CDN Benefits

  • Significant drop in TTFB
  • Clear optimization of FCP/LCP
  • Improved global access stability

🎯 2. W3TC Page Cache Is the Key Variable

Root cause of the performance degradation:

❗ It was not the CDN, but rather that Page Cache had been disabled.


🎯 3. The Performance Issue Is Fundamentally a Cache Loop Issue

Plaintext
CDN + Page Cache + Object Cache

All three are indispensable.


🧠 XI. Key Cognitive Correction (Very Important)


❌ Old Understanding

  • Page Cache does not work under Nginx
  • CDN degradation = CDN problem
  • Whether caching is configured determines performance

✅ New Understanding

  • Page Cache actually works natively
  • CDN issues are often cache state issues
  • The key to performance is “whether cache hits occur”

🧭 XII. Final Architecture (After Verification)

Plaintext
User
 ↓
Cloudflare CDN
 ↓
Nginx
 ↓
W3 Total Cache Page Cache
 ↓
PHP-FPM
 ↓
WordPress
 ↓
Redis Object Cache

🎯 XIII. One-Sentence Summary

The essence of WordPress performance optimization is not simply adding a CDN or caching, but ensuring the caching system forms a complete loop and actually scores cache hits.

系列导航

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系