It’s no secret. Your web site needs to load fast.
We all know the effect that page load times have on user experience, but did you know that a fast loading site can gain some SEO benefits as well? Even as early as 2008 experts have made the claim that,
“It would be unwise to assume this form of measurement (page load time) isn’t taken when search engines perform their quality score in relations to your PPC campaigns. It would be unwise for them to list a slow site in the top listings.” –Aaron Shear, High Performance SEO Requires Fast Load Times
If you are running WordPress, there are plenty of options available to you to help speed up your site; and the most effective is caching your content. So instead of building everything on a page processing the PHP code and calling the database everything will be saved to a disk so that visitors will not have to sit through the entire process.
Setting Up Caching
WordPress has the ability to cache content built in, so you really don’t need to install anything extra. However, not everyone who runs a WordPress site likes to get their hands dirty with code so in addition to showing you how to configure caching in WordPress, we will also cover some plugins that will take care of this for you. Of course, you could combine setting up the internal cache with a plugin to see a really nice improvement.
Browser Caching
We can manually reduce the amount of HTTP requests that are server has to process, and thus reduce page load times, by using what is called browser caching. By taking these steps, our site will cache static files like images, CSS, JavaScript, etc.
To enable this, we will have to modify the .htaccess file. Once open, you will add the following code:
## EXPIRES CACHING ## ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" ## EXPIRES CACHING ##
When you have pasted this into your .htaccess file, simply save it and upload it back to your server. Note that each file type has an expiration date for how long it stays in the cache. For more information about the Expires header, check out the Apache documentation.
WP Super Cache
This plugin has been included on a number of Best Plugins lists because it is easy to install and configure; but also because it works.
Once installed, you need to simply navigate to Settings ? WP Super Cache and turn WP Super Cache Status to ON. When you click on the Update Status button, your caching will start. You can periodically check your cache using the Test Cache button and even use the Advanced tab, along with the other tabs, to customize how your site caches content.
W3 Total Cache
Like WP Super Cache, this is a plugin that makes the whole concept of caching easy for non-technical users to implement on their site. Once installed and activated, click on the Performance tab on the side menu.
The initial screen offers some information regarding your Google Page Speed Report and about your site’s load times. You can also purchase premium services here as well. Navigating to Performance > General Settings allows you to enable what content you wish to cache. Turning on all caching types can be done by checking that box under General and then clicking on the Save all settings button. You also have the option to customize what you cache with Page Cache, Minify (for CSS, JavaScript and HTML), Browser Cache, CDN and much more.
Caching is definitely something that should be implemented on any WordPress site, not only for your site’s benefit; but to make it a better experience for your visitors as well.
Stay tuned as we cover all the various aspects of caching and what they can do for your site in our Advanced Caching post that is in the works!