Appearance
Caching Strategies
This guide explains caching implementation and strategies in LamaPress.
Table of Contents
Overview
Caching improves performance by storing frequently accessed data. LamaPress implements various caching strategies for optimal performance.
Browser Caching
Cache Headers
Set cache headers for assets:
php
// In .htaccess or server config
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>Asset Caching
Vite handles asset caching:
- Filenames include hash for cache busting
- Long cache times for hashed assets
- Automatic cache invalidation on changes
Server-Side Caching
Page Caching
We use WP Rocket for page caching. WP Rocket provides:
- Page caching
- Database optimization
- Cache preloading
Related Documentation
- Performance Optimization - Performance strategies
- Deployment Overview - Deployment process
- Build Process - Build system
Next Steps:
- Review Performance Optimization for performance
- Check Deployment Overview for deployment
- See Build Process for build details