Performance & Caching
Optimize performance for sites with thousands of files.
Overview
PraisonPressGit includes intelligent caching and indexing systems to handle sites of any size efficiently.
Caching System
WordPress Transients
File content is cached using WordPress transients:
// Configure cache TTL
add_filter('praison_cache_ttl', function($ttl, $post_type) {
if ($post_type === 'lyrics') {
return 7200; // 2 hours for lyrics
}
return $ttl;
}, 10, 2);
Cache Invalidation
Cache automatically invalidates when: - Files are modified - Admin clears cache manually - TTL expires
Clear Cache
Admin Dashboard: Click "Clear Cache" in the PraisonPress dashboard
WP-CLI:
Index System
For large sites (1,000+ files), enable the index system:
Build Index
Index Benefits
| Site Size | Without Index | With Index |
|---|---|---|
| < 1,000 | 0.5s | 0.2s |
| 1,000 - 10,000 | 2-5s | 0.2s |
| 10,000 - 100,000 | 10-30s | 0.5-2s |
Scaling Guide
Small Sites (< 1,000 files)
Medium Sites (1,000 - 10,000 files)
Performance: ~0.2s load time (5x faster)
Memory: ~80MB
Cache: Transients + Object cache
Index: Recommended
Large Sites (10,000 - 100,000 files)
Performance: ~0.5-2s load time (50x faster)
Memory: ~150MB
Cache: Redis/Memcached required
Index: Required
Object Cache
For best performance, use Redis:
Install Redis Object Cache plugin: