Skip to content

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

Next Steps:

Released under the MIT License.