Overview
The translation cache system stores translated content for rapid retrieval, dramatically improving site performance and reducing API costs.
How Translation Caching Works
Basic Flow
- Request: Visitor selects a language
- Cache Check: System looks for cached translation
- Cache Hit: If found, serve instantly (milliseconds)
- Cache Miss: If not found, generate translation
- Store: Save new translation to cache
- Serve: Display to visitor
- Database: WordPress database tables (
wpstptranslations) - Object Cache: Redis/Memcached if available
- File Cache: Optional file-based caching
- CDN Cache: Compatible with CDN caching layers
- Enable Translation Cache: ✅ On (recommended)
- Disable for Development: ⬜ Off
- Short (7 days): For frequently updated content
- Medium (30 days): Standard, balanced approach
- Long (90 days): For static content, saves API costs
- Permanent: Never expire (manual clear only)
- Custom: Set specific duration in hours/days
- Longer = Better performance, lower costs
- Shorter = More up-to-date automatic translations
- Balance based on content update frequency
- When post/page is updated
- When manual translation is added/edited
- When source content changes
- When plugin settings change
- Clear all cache
- Clear specific language
- Clear specific post/page
- Clear by date range
- Fastest possible loading
- Entire page served from cache
- No database queries needed
- More storage required
- May cache dynamic elements
- More flexible than page cache
- Allows dynamic elements
- Smaller storage footprint
- Slightly slower than page cache
- More complex to manage
- Consistency across site
- Reduces redundant translations
- Speeds up new content translation
- Recognizes repeated phrases
- Reuses existing translations
- Builds over time
- “Add to Cart” appears on 100 product pages
- Translated once, reused 100 times
- Consistent translation everywhere
- Indexed tables for fast lookups
- Automatic cleanup of old entries
- Compressed storage (reduces size by 40-60%)
- Redis support
- Memcached support
- APCu support
- Automatic detection and use
- Store translations as static files
- Served directly by web server
- Fastest possible delivery
- Total Cached Items: Number of translations stored
- Cache Size: Storage space used
- Hit Rate: Percentage served from cache
- Miss Rate: Percentage requiring new translation
- API Calls Saved: Estimated cost savings
- Average Load Time: Performance improvement
- Monitor cache effectiveness
- Identify underperforming content
- Optimize cache settings
- Track cost savings
- Clear All Cache
- Clear Specific Language
- Clear by Post Type
- Clear by Date
- Clear Single Item
- After plugin updates
- When translations look wrong
- After theme changes
- When testing new configurations
- Periodically (e.g., monthly) for freshness
- Enable Auto-Cleanup: ✅ On
- Cleanup Interval: Daily, weekly, or custom
- Keep Last: Keep translations from last X days
- Max Size: Limit cache size (GB)
- Translations older than retention period
- Orphaned translations (content deleted)
- Duplicate entries
- Corrupted cache entries
- No “first visitor” slowdown
- Consistent fast performance
- Better user experience
- Manual Warming:
- Automatic Warming:
- Scheduled Warming:
- Pages to Warm: All, published, recent, or custom list
- Languages: Which languages to warm
- Schedule: Immediate, hourly, daily
- Batch Size: How many items per batch (prevents timeouts)
- Translation API call: 200-500ms
- Database queries: 50-100ms
- Total delay: 250-600ms per page
- Cache retrieval: 5-20ms
- No API calls needed
- Total delay: 5-20ms per page
- 10,000 page views/month
- 3 languages
- Without cache: 30,000 API calls
- With cache (95% hit rate): 1,500 API calls
- Savings: 95% reduction in API costs
- Without cache: ~$60/month (at $20/1M characters)
- With cache: ~$3/month
- Savings: $57/month
- Cache stored in database or object cache
- Minimal RAM usage
- Object cache (Redis) more efficient than database
- Cache hits require minimal processing
- Reduces server load significantly
- Allows handling more concurrent visitors
- Indexed tables for fast queries
- Minimal database load
- Regular cleanup prevents bloat
- Redis (recommended for high-traffic sites)
- Memcached
- APCu
- WinCache
- Install object cache on server (ask hosting provider)
- Install WordPress object cache plugin (e.g., Redis Object Cache)
- ShahiTranslate Pro auto-detects and uses it
- No additional configuration needed
- 5-10x faster than database cache
- Reduces database load
- Scales better for high traffic
- Cloudflare
- KeyCDN
- StackPath
- Amazon CloudFront
- All major CDN providers
- Translated pages cached at CDN edge servers
- Served from location nearest to visitor
- Bypasses your server entirely
- Enable language-specific caching on CDN
- Configure cache keys to include language parameter
- Set appropriate cache durations
- Test with multiple languages
- URL with language parameter (/es/, /fr/, etc.)
- Cookie: stp_language
- Visitor’s browser caches pages
- Fastest possible (0ms load time)
- Duration: 1 hour – 1 day
- CDN edge servers cache pages
- Very fast (10-50ms)
- Duration: 1 day – 1 week
- Redis/Memcached on your server
- Fast (5-20ms)
- Duration: 1 week – 1 month
- Stored in WordPress database
- Fast (20-100ms)
- Duration: 1 month – permanent
- Cache is enabled in settings
- Disk space available
- Database tables created properly
- No caching plugin conflicts
- Enable cache in settings
- Verify database tables exist
- Check error logs
- Temporarily disable other caching plugins
- Cache not invalidated on update
- Very long cache duration
- External caching layer not cleared
- Manually clear cache for affected content
- Reduce cache duration
- Configure CDN to purge on update
- Enable automatic cache invalidation
- Reduce cache duration
- Enable auto-cleanup
- Set maximum cache size
- Use compression (enabled by default)
- Limit cached languages
- Cache hit rate (should be >90%)
- Object cache properly configured
- No database bottlenecks
- CDN working correctly
- Warm cache for popular content
- Optimize database (repair/optimize tables)
- Verify object cache plugin active
- Check CDN configuration
- Cache Enabled: ✅ Yes
- Duration: 30 days
- Auto-Cleanup: Enabled, weekly
- Object Cache: Use if available
- Cache Warming: Enable for top pages
- Cache Enabled: ✅ Yes
- Duration: 90 days
- Object Cache: Redis (required)
- CDN: Enabled
- Cache Warming: Scheduled, all content
- Cache Enabled: ✅ Yes
- Duration: 7 days
- Auto-Cleanup: Enabled, daily
- Invalidate on Update: ✅ Yes
- Selective warming: Recent content only
- Cache hit rate (aim for 95%+)
- Average page load time
- API usage and costs
- Storage usage
- Error rates
- Plugin dashboard
- Google Analytics (page speed)
- Server monitoring (APM tools)
- API provider dashboard (Google Cloud)
- Low hit rate → Warm cache, increase duration
- High API costs → Check cache working
- Slow pages → Enable object cache, CDN
- High storage → Enable cleanup, reduce duration
- Performance Optimization
- SEO Settings
- Troubleshooting Cache Issues
Cache Storage
Translations are stored in:
Cache Configuration
Location: ShahiTranslate Pro → Settings → General → Cache Settings
Enable/Disable Caching
– Improves performance by 10-50x
– Reduces API costs by 90%+
– Essential for production sites
– Useful during testing
– See changes immediately
– Not recommended for live sites
Cache Duration
Default: 30 days
Settings:
Considerations:
Cache Invalidation
Automatic Invalidation:
Manual Invalidation:
Cache Types
Page Cache
What It Caches: Complete page translations
Benefits:
Limitations:
Best For: Static pages, blog posts, product pages
Fragment Cache
What It Caches: Individual content pieces
Benefits:
Limitations:
Best For: Sites with dynamic content, personalization
Translation Memory Cache
What It Caches: Common phrases and segments
Benefits:
How It Works:
Example:
Cache Performance
Storage Optimization
Database Optimization:
Object Cache Integration:
File Cache (Optional):
Cache Statistics
Location: ShahiTranslate Pro → Dashboard → Cache Statistics
Metrics Displayed:
Using Statistics:
Cache Management
Clearing Cache
Location: ShahiTranslate Pro → Settings → General → Cache Settings → Clear Cache
Options:
– Removes all cached translations
– Use when: Plugin updated, major changes made
– Impact: Temporary performance decrease
– Remove cache for one language only
– Use when: Language-specific issues
– Impact: Minimal, affects only that language
– Clear posts, pages, or custom post types
– Use when: Content structure changed
– Impact: Moderate, specific content type affected
– Remove cache older than X days
– Use when: Want to refresh old translations
– Impact: Varies based on date range
– Remove cache for specific post/page
– Use when: Individual page updated
– Impact: Minimal, one item only
When to Clear Cache:
Automatic Cleanup
Auto-Cleanup Settings:
What Gets Cleaned:
Cache Warming
What It Is: Pre-populate cache before visitors arrive
Benefits:
How to Use:
– Go to ShahiTranslate Pro → Tools → Warm Cache
– Select language(s) to warm
– Choose content to translate
– Click “Start Cache Warming”
– Enable in settings
– Runs after content published
– Background processing (doesn’t slow site)
– Set up cron job
– Warm cache at low-traffic times
– Ensure cache always full
Configuration:
Cache and Performance
Page Load Times
Without Cache:
With Cache:
Improvement: 10-100x faster
API Cost Savings
Example Scenario:
Monthly Cost Comparison:
Hosting Resource Usage
Memory:
CPU:
Database:
Advanced Caching
Object Cache Integration
Supported Systems:
Setup:
Benefits:
CDN Caching
Compatible CDNs:
How It Works:
Setup:
Configuration Example (Cloudflare):
`
Cache Key:
Cache TTL: 1 day
`
Multi-Level Caching Strategy
Level 1 – Browser Cache:
Level 2 – CDN Cache:
Level 3 – Server Object Cache:
Level 4 – Database Cache:
Result: Maximum performance at every level
Troubleshooting Cache Issues
Cache Not Working
Check:
Solution:
Stale Content
Issue: Old translations showing after content update
Causes:
Solutions:
High Storage Usage
Issue: Cache consuming too much disk space
Solutions:
Performance Not Improving
Check:
Solutions:
Best Practices
Recommended Settings
For Most Sites:
For High-Traffic Sites:
For Frequently Updated Sites:
Monitoring
What to Monitor:
Tools:
Actions Based on Monitoring:
Next Steps
Share this article
Still need help?
Our support team is ready to assist you with personalized guidance for your workspace.