Categories: Blog

How to Add Expire Headers to Speed Up your WordPress Site

Optimize your WordPress Site for SEO and Reduce your Bounce Rates.

Let us take care of it for you, for free!

All new hosting and maintenance clients receive a free HOUR of support each month for theme or plugin fixes, site optimization or malware removal!

GET FREE WP FIX NOW! While there are many different things you can do in order to make your site faster I'm going to post a little snippet to add in your .htaccess file that will set your Expire Headers time.

The faster your site loads the better is for your SEO and for your Bounce Rates.

Expire Headers is letting your browser to cache your website content and request them only after the time specified in that rule expires.

If you want to set Expire Headers for all of your image,js and css file you have to open and edit your .htaccess file and the following rule:

<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css|woff)




quot;> ExpiresActive On ExpiresDefault A2592000 </FilesMatch>

FilesMatch sets the file extensions that are affected by the ExpiresActive rule while the ExpiresDefault sets the cache time, when that time expires then your website visitor browser will request once more the files.

ExpiresDefault is access time (A) plus 30 days (2592000 seconds), so using the same rule you can set your own ExpiresDefault time(just be careful to calculate in seconds).

If you want to set a separate Expire Headers rule for each of your filetypes then you can use the following snippet on your .htaccess.

ExpiresByType image/png A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000

Let us take care of it for you, for free!

All new hosting and maintenance clients receive a free HOUR of support each month for theme or plugin fixes, site optimization or malware removal!

GET FREE WP FIX NOW!
Makis Mourelatos

WC Athens 2016 co-organizer, WP Support and Security Aficionado, Wannabe Kitesurfer.

View Comments

Share
Published by
Makis Mourelatos

Recent Posts

WordPress Theme Development

WordPress is a widely popular Content Management System (CMS) that powers over 40% of all…

12 months ago

WordPress Solutions

WordPress is a popular platform that empowers more than 60 million websites worldwide. Millions of…

12 months ago

WordPress Site Maintenance

In this article, we will cover ten crucial WordPress site maintenance tasks that every website…

12 months ago

WordPress Security Solutions

In this blog article, we will explore the various WordPress security solutions you can implement…

12 months ago

WordPress Plugin Solutions

Plugins are an integral part of WordPress, as they offer countless benefits and features that…

12 months ago

WordPress Optimization and Performance Improvement

In this article, we will explore various strategies that can help you enhance your WordPress…

12 months ago