🧩 1. Background
While optimizing the performance of a WordPress site, I tried using:
- W3 Total Cache
- Redis Object Cache
- Nginx + OneinStack environment
The goal was:
To improve page loading speed and prepare for the upcoming CDN (Cloudflare) deployment.
🧪 2. Problem Symptoms
During inspection, I found the following anomalies:
1️⃣ Abnormal page response headers
cache-control: no-cache, no-store, private👉 This indicates that the page was still being dynamically generated with no cache hit. Even in the browser’s incognito mode, there was still no cache hit, showing that the issue was not caused by the logged-in state.

2️⃣ W3 Total Cache shows “Enabled”
The dashboard shows:
- Page Cache: Disk: Enhanced (Enabled)
- Object Cache: Redis (Enabled)
However, the actual behavior did not match.

3️⃣ view-source shows W3TC is active
The page source contains:
Performance optimized by W3 Total Cache👉 This indicates the plugin was running normally but was not serving cached output.

🧭 3. Debug Process
1️⃣ Check Redis status
Redis Object Cache was working normally:
- No errors
- Query acceleration functioning normally
2️⃣ Check Page Cache type
It was set to:
Disk: Enhanced
3️⃣ Check Nginx environment
Server environment:
- Nginx
- OneinStack
Key finding:
👉 There are no W3TC rewrite rules in the Nginx configuration
[root@iZ23wv7v5ggZ www.shuijingwanwq.com]# grep -R "w3" /usr/local/nginx/conf -n | head
/usr/local/nginx/conf/ssl/tym-jammerall.shuijingwanwq.com.key:19:xWMHw3vC5eU6ZpcY/jJMKc9eO1zULxxx
/usr/local/nginx/conf/ssl/tym-jammerall.shuijingwanwq.com.crt:60:wQM5YPIk0NDJFw3NhQPOIOwbqxxx
/usr/local/nginx/conf/ssl/www.shuijingwanwq.com.crt:60:wQM5YPIk0NDJFw3NhQPOIOwbq09T+SYSEZxxx
[root@iZ23wv7v5ggZ www.shuijingwanwq.com]#
4️⃣ Verify cache hits
Checking via DevTools:
- No
x-w3tc-cache: hit - No cache hit header
- HTML is still dynamically generated
🚨 4. Root Cause
Core issue:
❗ W3 Total Cache’s Disk: Enhanced mode is not integrated with rewrite / fastcgi cache rules in the Nginx (OneinStack) environment
Underlying structural issue:
❌ 当前:Nginx → PHP → WordPress(每次生成)❌ 没有:Nginx → Cache HTML(未生效)💥 5. Key Conclusion
Although W3 Total Cache shows:
- ✔ Page Cache enabled
- ✔ Redis enabled
In reality:
❗ Page Cache was not actually working
🧹 6. Final Decision (Solution)
After troubleshooting, I ultimately decided to:
👉 Disable W3 Total Cache Page Cache
Retain:
- ✔ Redis Object Cache
- ✔ Browser Cache

🌐 7. Optimized Architecture (Final Architecture)
用户 ↓Cloudflare CDN(未来) ↓Nginx(OneinStack) ↓WordPress ↓Redis Object Cache🎯 8. Key Takeaways
✔ 1. W3TC is not plug-and-play in Nginx environments
Disk: Enhanced relies on rewrite or fastcgi cache.
✔ 2. “Enabled ≠ Working”
You must verify:
- Response Headers
- cache hit status
- Whether the HTML is dynamically generated
✔ 3. Redis + CDN is a more stable solution
Page Cache is not a mandatory component.
✔ 4. OneinStack requires additional Nginx configuration support
Otherwise, Page Cache will not work.
⚠️ Important Note (Conclusion Correction)
In this article, I initially reached the following conclusion:
❌ W3 Total Cache Page Cache does not work by default in a Nginx + OneinStack environment and requires additional Nginx rewrite or fastcgi cache configuration support
🧠 Follow-up Verification Results (Important Update)
During subsequent performance comparison tests before and after CDN deployment, this conclusion was re-verified and corrected:
👉 For detailed analysis, please refer to:
✅ The latest corrected conclusion is as follows:
- W3 Total Cache Page Cache works by default under Nginx + OneinStack
- No additional rewrite or fastcgi cache configuration is required
- The previous misjudgment stemmed from a misinterpretation of the cache miss state

