Enable Browser Caching in WordPress using .htaccess file

I attempted to update the .htaccess file in my wordpress root directory, but it still doesn’t appear to be working properly because when I run my site through googles page speed test the test results indicate that I should consider caching certain jpegs being loaded to that page.

This is my .htaccess file after making modifications.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

# Expire
<ifmodule mod_expires.c>
<Filesmatch ".(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
    ExpiresActive on
    ExpiresDefault "access plus 2 days"
# End Expire

Any help would be much appreciated.

Read more here: Enable Browser Caching in WordPress using .htaccess file

Leave a Reply

Your email address will not be published. Required fields are marked *