Trying to speed up your WordPress website? You could try to add expires headers into your WordPress .htaccess file to help with this.
2 answers
1
Add expires headers to .htaccess file
To add expires headers into your WordPress .htaccess file without a plugin, follow the steps below:
- FTP into your WordPress website’s server.
- Open your .htaccess file, located in the root of your WordPress installation.
- Copy and paste in the code from below.
- Save and re-upload accordingly.
<IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 month" ExpiresByType image/x-icon "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 year" </IfModule>
Note, you can also edit your .htaccess file without using an FTP if you have Yoast SEO installed.
— Support WizardAnswer 1
0
Using a plugin to add expires headers
Using the WP Fastest Cache plugin, you’re able to instantly add the expires headers into your .htaccess file without any coding necessary.
— Support WizardAnswer 2