Why Browser Caching Matters

Faster repeat visits: Reduces server load and improves page speed.

Add to .htaccess

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresDefault "access 2 days"
</IfModule>

Verify It's Working

Browser Dev Tools

Network tab → Reload → Check 'Cache-Control' and 'Expires' headers.

Recommended Cache Times Table

File TypeCache Duration
Images (jpg, png, gif)1 year
CSS & JS1 month
HTML2 days (or no-cache)
Fonts1 year