To add Expires Headers in WordPress using htaccess. Add the following code in your htaccess file located in WordPress root folder.

#BEGIN EXPIRES CACHING 
<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType text/css "access 1 month"
	ExpiresByType text/html "access 1 month"
	ExpiresByType image/gif "access 1 year"
	ExpiresByType image/png "access 1 year"
	ExpiresByType image/jpg "access 1 year"
	ExpiresByType image/jpeg "access 1 year"
	ExpiresByType image/jp2 "access 1 year"
	ExpiresByType image/x-icon "access 1 year"
	ExpiresByType image/svg+xml "access plus 1 month"
	ExpiresByType audio/ogg "access plus 1 year"
	ExpiresByType video/mp4 "access plus 1 year"
	ExpiresByType video/ogg "access plus 1 year"
	ExpiresByType video/webm "access plus 1 year"
	ExpiresByType application/atom+xml "access plus 1 hour"
	ExpiresByType application/rss+xml "access plus 1 hour"
	ExpiresByType application/pdf "access 1 month"
	ExpiresByType application/javascript "access 1 month"
	ExpiresByType text/x-javascript "access 1 month"
	ExpiresByType text/x-component "access plus 1 month"
	ExpiresByType application/x-shockwave-flash "access 1 month"
	ExpiresByType font/opentype "access plus 1 year"	
	ExpiresByType font/truetype "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-opentype "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/font-woff2 "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresDefault "access plus 1 year"
</IfModule>
#END EXPIRES CACHING

Have any doubt, then comment here!

Leave a Reply

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