Caches and Why We Clear Them
So you have great new business website. You’re using quality hosting that’s appropriate for website size and scope, and it’s performing pretty well, but could it perform better? There are other things you can do to help your website be as fast as possible, to reduce it’s size, and to minimize the impact it has on your server and hosting.
Caching can have a huge impact on your website. It can make it load more quickly for your users. It can reduce the number of files and the size of the files that a user’s browser needs to download when they visit your site. It can also reduce the resources that your web server uses – this can be especially helpful if you’re on shared hosting or if your hosting package has resource limitations.
What is Caching?
Types of Caching
While caching is a very effective tool, it is not one size fits all. There are things you need to consider in determining what settings and configuration to use.
How often do you update your site?
Are you adding new posts or pages to your site once a week? Multiple times a day? Do you have an ecommerce site where you are adding new products or they are changing constantly? Depending on how often you make updates, you’re going to want to set your cache expiration to match. Caching pages for weeks is going to cause problems if you’re updating content every day.
What types of static content do you have on your site?
What types of dynamic content do you have on your site?
Does your site have dynamic content? Do you have plugins loading content from Instagram or Facebook? Do you have personalization on your site for customers? Things like this should be being handled with AJAX, but if they are not, caching pages that have this functionality could cause problems.
Where are your users located?
Is your business fully local and you contained to your neighborhood or city? Do people from Europe or Australia regularly access your content? Are you running a web store and your products popular all over the country? Depending on the geography of your online presence, a CDN service like Cloudflare could be hugely impactful. Cloudflare has more than 150 server locations all over the globe. Having cached versions of your site content in their regional edge cache, could greatly improve the experience of your users across the country, or on another continent.
Common Caching Issues
One of the single most frequent things we run into is “Help! I updated a post/page/theme/plugin and my site is broken!” This happens ALL the time. Many people are quick to blame the theme or the plugin. It must have been a bad update. The developers must have done something wrong. While this is a possibility, it is rarely the case. It’s almost ALWAYS a caching issue. When you update posts, products, or pages and the new changes don’t show up immediately, it’s usually because the old version is cached on the server or the user’s browser. The caches just need to be cleared and updated as well.
More seriously, when you update themes and plugins, the code to the site changes. Themes and plugins can be made up of dozens or hundreds of files. When they are updated, not ever file changes, but many do. If you have caching enabled on your site, server, or have browser caching instructions on your site, this can cause major issues. The wrong versions of the code can be saved on the server, or in a user’s browser. When the browser tries to load old versions of the code mixed with new files from the update…things can and will break. This does not mean something is wrong with the theme, or with the plugin, simply that you need to clear your caches!
Recommended Caching Solutions
This is a list of recommended plugins to help you with caching on your WordPress site. Some plugins will work better with certain hosting environments or configurations. If you don’t have great success with one, you can try another.
Swift Performance Lite/Pro
Swift Performance is a relative newcomer, but it’s an excellent plugin. We use it on quite a few sites and have had some great success. There is a free version and paid version, but even the free version has a robust feature set. The premium features are worth the additional price if you decide to upgrade. There is a bit of a learning curve.
WP Rocket is an excellent paid plugin. It has a full feature set and is very user friendly. For most situations you can use their recommended settings and get great results. Their customer service is also great.
Cache Enabler is a very simple and straightforward plugin. It’s developed by the people from KeyCDN and it’s got a great reputation for working well with it’s limited feature set.
Hummingbird is another plugin that has free and paid versions. The free version has a solid feature set and an easy to use interface. The paid version has additional features but is only available as part of a bundle.
Cloudflare is more than just a CDN, it also provides security features, DNS management, and caching across their entire global network. Their free offering doesn’t really have anything that can compete and their paid features are very robust.
KeyCDN and StackPath
KeyCDN and StackPath’s offerings and pricing are very similar. Their CDN features are both solid and easy to use. They don’t have quite as many features as Cloudflare, or the sheer size of their network, but they are both great options.
Recommended Update Procedure
- First, if your hosting has a staging environment, use it. If not it’s recommended that these steps are first done on a local development copy of your site.
- Second, and most importantly, make sure you take a backup of your site.
- Third, update your plugins. Check to see if there are any issues after each one. Clear your caches (ALL of them. Your server cache, page cache, browser cache, object cache, and edge cache/CDN all need to be cleared.)
- After your plugins are updated, you can go ahead and update your theme. Clear your caches. Check to see if there are any issues.
- Finally, update WordPress. Clear your caches. Check to see if there are any issues.
- If you successfully complete these steps on your local development or staging site, repeat the process on your live site or push the staging copy to live.