When your visitor revisits or browses through your website, all images and files have to be downloaded every time the page refreshes or changes. If you add expires tags on all your files, you can effectively allow the browser to reuse what it has already downloaded without unnecessarily downloading the same file over and over effectively speeding up your website and saving on valuable bandwidth.
If you are looking to improve the load times of your website, to decrease server bandwidth, and to have a higher PageSpeed/Yslow score, then you should have the Expire tag built into all your files. Keep in mind that this tweak does not reduce first page load times, it only allows the browser to skip requesting the same files. The browser will listen to your Expires Headers commands, and will not check for new updated files until the time you allocate has expired. To reiterate, It simply tells the browser to use the data it has already downloaded from the first page it loaded, the landing page, and use that data throughout the visit on your website. This means faster subsequent page loading and less bandwidth used on your server. Java script, CSS, Menu Images, and regular repeating images like logos benefit the most from this.
The way I have choosen to integrate this into my website is simple. You must find your .htaccess file and simply add the following lines to the bottom of it. This tweak works great with Joomla to increase your users browsing experience.
- # Expire images header
- ExpiresActive On
- ExpiresDefault A0
- ExpiresByType image/gif A2592000
- ExpiresByType image/png A2592000
- ExpiresByType image/jpg A2592000
- ExpiresByType image/jpeg A2592000
- ExpiresByType image/ico A2592000
- ExpiresByType text/css A2592000
We try to give credit where credit is due with proper back linking to help spread link juice. Some of this information was found at TipsAndTricks-Hq