Caching Strategies: Page Caching, Browser Caching, and Object Caching Explained
Caching is the single most effective way to speed up WordPress. A properly cached WordPress site can be 5-10x faster than an uncached site.
Yet many site owners don't implement caching, thinking it's complex. In reality, modern caching plugins make it simple.
Let's explore caching layers and how they work together.
The Caching Hierarchy
There are multiple levels where caching happens:
- Browser cache - User's device
- CDN cache - Global edge servers
- Server cache - Page cache
- Application cache - Object/query cache
- Database - Query cache
Each layer dramatically reduces load on the next layer.
Level 1: Browser Caching
Browser caching stores files on the visitor's device (computer, phone).
How it works:
- User visits your site
- Browser downloads images, CSS, JavaScript, fonts
- Browser stores these files locally (cache)
- Next visit: Browser uses local files instead of downloading again
- Files served from disk (50-1000x faster than internet)
Browser cache headers:
Cache-Control: public, max-age=2592000
This tells browser: "Keep this file for 30 days"
What to cache:
- Images: 1-6 months (doesn't change often)
- CSS/JavaScript: 1 week (might update)
- Fonts: 1-12 months (rarely change)
- HTML pages: 1-24 hours (content might change)
Configuration (via .htaccess):
<FilesMatch "\.(jpg|jpeg|png|gif|ico|css|js|woff)$">
Header set Cache-Control "public, max-age=31536000"
</FilesMatch>
<FilesMatch "\.html$">
Header set Cache-Control "public, max-age=3600"
</FilesMatch>
Plugin handling: Most caching plugins (W3 Total Cache, WP Super Cache) set these headers automatically.
Performance impact: 20-30% improvement on repeat visits
Level 2: Server-Side Page Cache
Page cache stores complete HTML pages in memory or disk, bypassing PHP execution.
How it works:
- First visitor requests homepage
- WordPress runs (slow): PHP → Database → HTML generated
- Page cache saves HTML to disk/memory
- Next visitor gets pre-generated HTML (no PHP execution)
- Subsequent visitors get this cached HTML instantly
Cache generation:
- Admin requests page → Cache rebuilt
- Scheduled (hourly, daily)
- TTL expires → Cache rebuilt
What gets cached:
- Public pages (blog posts, pages)
- NOT logged-in pages
- NOT admin pages
- NOT dynamic content (real-time data)
Caching plugins:
- W3 Total Cache - Full-featured, complex
- WP Super Cache - Simple, effective
- Hyper Cache - Lightweight alternative
Setup (WP Super Cache):
- Install and activate
- Go to Settings → WP Super Cache
- Enable caching
- Set cache timeout (3600-86400 seconds)
- Choose cache delivery method (PHP recommended for beginners)
Performance impact: 50-70% improvement for non-logged-in users
Level 3: Object/Query Caching
Object cache stores database query results and PHP object data in memory (Redis, Memcached).
Problem it solves: Every WordPress page request might query the database 50-200 times:
- Get post data
- Get post meta
- Get widgets
- Get theme options
- Get plugins data
Without caching: Query database 50+ times per request With object cache: Query database once, cache data in RAM
How it works:
- First request queries database for post data
- Result stored in Redis (RAM)
- Next request: Get data from Redis (100-1000x faster)
- Cache expires or updates on post edit
Redis vs. Memcached:
- Redis - Faster, more features, persistent
- Memcached - Simpler, good for beginners
Setup requires:
- Redis/Memcached installed on server (most managed hosts have it)
- WordPress plugin to connect (Redis Object Cache, W3 Total Cache)
Installation (Redis Object Cache plugin):
- Install "Redis Object Cache" plugin
- Activate
- Plugin detects Redis automatically (if installed)
- Click "Enable Object Cache"
Performance impact: 30-50% improvement by reducing database queries
Level 4: Database Query Cache
Database itself caches frequently-used queries.
MySQL query cache (older versions):
- Stores frequently-run query results
- Returns cached results for identical queries
- Automatic
Modern approach (MySQL 8.0+): Query cache removed (deprecated) Instead rely on object caching layer above.
Performance impact: 10-20% on its own (object cache handles this now)
Level 5: CDN Cache
CDN stores static files globally.
Already covered in previous post, but briefly:
- Static files (images, CSS, JS) cached at global edge locations
- Visitor downloads from nearest location
- 30-60% improvement for geographically distributed visitors
Full Caching Stack Implementation
Recommended setup for most sites:
1. Browser Cache Headers (built-in or plugin)
↓
2. Page Cache (W3 Total Cache or WP Super Cache)
↓
3. Object Cache (Redis via Redis Object Cache plugin)
↓
4. CDN Cache (Cloudflare or KeyCDN)
Installation order:
- Start with page cache (biggest impact)
- Add browser cache headers
- Add object cache if Redis available
- Add CDN if site is global
Cache Invalidation: When to Clear Cache
Cache expires in two ways:
Time-based (TTL):
- Cache set to expire after X seconds
- Example: Page cache expires after 1 hour
- Automatic, predictable
Event-based (purge):
- Cache cleared when content changes
- Example: Edit post → page cache cleared immediately
- Requires monitoring
What triggers cache clearing:
- Edit post/page → Page cache clears
- Publish comment → Page cache clears
- Update plugin → All cache clears
- Update theme → All cache clears
- Manually clicked in admin
Caching plugins handle this automatically - you don't need to manually clear cache for most operations.
Cache TTL Settings
Page cache TTL:
- Blog posts: 1-24 hours (content might change)
- Product pages: 1 hour (price might change)
- Homepage: 1-4 hours
- Archive pages: 6-12 hours
Static file cache TTL:
- Images: 1-12 months (rarely change)
- CSS/JS: 1 week (updates periodically)
- Fonts: 12 months (never change)
Object cache TTL:
- Automatic (usually 12 hours default)
- Some plugins use persistent cache (never expire unless cleared)
Measuring Cache Effectiveness
Before/after comparison:
Use tools like GTmetrix or PageSpeed Insights:
Before caching:
- First visit: 3 seconds load time
- Repeat visit: 3 seconds load time (no improvement)
After caching:
- First visit: 3 seconds load time
- Repeat visit: 0.5 seconds load time (6x faster)
Common Caching Issues and Solutions
Issue 1: Stale content showing
- Problem: Old page content still showing after update
- Solution: Clear cache manually or wait for TTL expiration
- Prevention: Set shorter TTL for frequently-updated content
Issue 2: Logged-in users see cached pages
- Problem: User sees another user's cached version
- Solution: Caching plugin should exclude logged-in users (it does)
- Verify: Check settings in caching plugin
Issue 3: Dynamic content not updating
- Problem: Real-time data (comments, widgets) shows old data
- Solution: Exclude dynamic content from caching
- Configuration: Most plugins handle automatically
Issue 4: Admin dashboard slow
- Problem: Cache is interfering with admin
- Solution: Disable cache for /wp-admin/
- Most plugins exclude admin by default
Caching Cost vs. Benefit
Free tier options:
- Browser cache headers: Free (built-in)
- WP Super Cache: Free and open-source
- Redis Object Cache (if host provides Redis): Free
Cost: $0-20/month for CDN if added
Benefit: 50-70% faster load times = 1-5% more conversions
ROI: Typically immediate positive ROI on any traffic-generating site
Conclusion
Caching isn't optional in 2026—it's essential. A properly cached WordPress site is fast, provides better user experience, ranks better in search, and converts more visitors.
Start with page cache (WP Super Cache, free). Add browser cache headers. If your host supports it, add Redis. Watch your performance transform.
Your visitors will thank you.
What caching strategy are you using? Have you seen dramatic speed improvements? Share your setup in the comments.
