Regardless of your experience with WordPress, it’s almost inevitable that – at some point – you’re going to want to experiment with caching your website.

Cache, Not Cash

Cache, Not Cash

For those who have a background in computing, you’re likely already familiar with caching:

  • how it works,
  • how to control it,
  • some of the pitfalls,
  • and many of its advantages.

If, on the other hand, you’re someone who wants a faster site, finds a plugin, and then begins turning options on and off, you may end up negatively affecting your site in some way.

Because WordPress is available a one-click install on so many web hosts, and because the plugin repository has a variety of caching plugins, it’s easy to get overwhelmed and/or try out a number of different plugins potentially altering the appearance of your site when users are viewing it.

And the latter happens to all of us. At least I hope. I had a cache issue late last week :).

Anyway, despite this laborious introduction, the purpose of this post isn’t necessarily to outline the advantages and disadvantages of caching. Instead, it’s meant to answer the question:

Should I use caching on a shared web host?

And though it’s not a difficult question to answer, it’s important to understand that you can only push the limits of your caching so far in that type particular environment.

Caching on a Shared Web Host

First and foremost, this is not a post promoting a particular plugin or service for caching. Instead, it’s meant to act as a simple answer to a question that I occasionally receive via email.

To that end, you’re not going to find any recommendations for plugins in this post (maybe in a future post).

Anyway, so when you’re on a shared web host, that means that your site is sitting alongside n-number of other sites on the same machine (or set of machines). So if the machine on which your site is hosted goes down, then all of the sites on that machine go down. You’re, you know, sharing the machine.

Hence the name.

The tradeoff is that you get cheaper hosting but less control over your server. As such, you don’t get to tweak some of the things such as server software, database performance, etc. as you would if you were using a dedicated server.

With that said, we still haven’t answered the initial question. The general answer:

Yes, you should use caching on a shared web host, but you won’t get the same benefits as if you were on a dedicated server.

In other words, sure! You’ll get some benefits, but not all of the benefits. And that’s okay, right? We don’t all have the desire or means to maintain a dedicated server, but why not make the most of what we have?

Here are the general notes I usually provide to others when considering caching on a web host:

  • Do not cache pages for users who are logged in, including yourself. You always want to have the most up to date information for your site. If you’re accessing cached information, you’re not doing that.
  • Be careful with automated CSS minification. Many times, if you allow a plugin to do this for you, you’re likely to notice that your site doesn’t look at all like it should. This is because something is being misapplied during the minification process. Although you’re decreasing the file size and the number of requests, you’re losing the presentation of your site.
  • Combine your JavaScript files, but test them. This is predicated on the idea that you know what each of the JavaScript files does. The more plugins you have running on your site, the more likely this is going to be difficult to test. But if you’re on the up and up with what the scripts are doing on each of your pages, then try to combine them and then test to make sure no functionality is lost. Once again, you’ve got fewer files and fewer requests.
  • Set your page cache. This may also be represented as “HTML minification” or something similar. When you view the source of a web page, the markup usually has a human readable flow (at least, sort of). When you minify your HTML, you’re basically placing all of the HTML on a single line (that will likely be word-wrapped in whatever editor you use to view the source). This is arguably one of the safest things you can do in order to cache your pages.
  • Browser Cache. This is a setting many plugins offer that will provide some extra information in the data sent along with your page that will instruct the browser to cache some of the assets on your visitors’ computer. This will help the page load faster when they revisit it.
  • Set a Cache Expiration. Most plugins will allow you to set a length of time – in seconds – that you can set your cache to expire. I recommend doing this because you don’t want to hold the same version of a page or your site in memory indefinitely. In fact, you’d really like to update the cache when a new comment is posted or a new page or post is published, but this is getting more into plugin configuration than it is general rules of thumbs to follow.

What About a Content-Delivery Network?

Regardless of whether a person is using a caching plugin, one of the questions that inevitably comes up along side this topic is:

Should I be using a content-delivery network?

Some will say yes, but I tend to say “it depends.” If you have a relatively busy site and you have visitors all over the world, then I’d say yes. You should be using a CDN.

In terms of what you should be using, that all depends on how busy your site is and the budget that you have. The top three available options that you’re likely to find are:

  • Photon is a Jetpack module that will allow you to automatigically host your images from one of the various data centers offered by Automattic. It does not include hosting of assets such as JavaScript and CSS, but it’s a good first-pass at speeding up your site.
  • CloudFlare is available on many web hosts and can be setup in the control panel of the site. In short, it’s a popular way to easily setup a CDN to host your images, your stylesheets, and your JavaScript files. CloudFlare also offers some security options. This is nice, but those security options might negatively impact speed as it works to determine if the incoming request is safe or not. As with many things, there’s a tradeoff.
  • MaxCDN is a service that does not offer a free plan (though the lowest tier is just $7.50 a month), and they do not offer the type of security options that CloudFlare does. That doesn’t mean there aren’t options for security (there obviously are), but acting purely as a CDN can help improve the speed of the site.

Sure, there are others, but if you’re on a shared host and are looking to squeeze out as much performance as possible, then these are the ones that are worth checking out. Of course, if you have others to recommend, please feel free to do so below.

What Do I Use?

As mentioned earlier, this post isn’t about promoting any particular plugin that I use. I will say, though, that I have some sites on shared hosts and some on dedicated hosts and I’ve always used some form of caching in the most recent years.

In a future post, perhaps I’ll outline what I prefer in terms of WordPress caching. For now, though, I’m interested in whatever it is you have to add to this particular post.

If there’s a plugin and/or CDN you’d like to recommend (or not), or a general rule of thumb that I neglected to cover in the post, then please feel free to share it in the comments.

Category:
Articles
Tags:

Join the conversation! 5 Comments

  1. Hi mate,

    This is timely, as I’m currently on shared hosting but considering moving to managed, with Pressidium.

    I used to use a mix of WP Super Cache and MaxCDN, then I used the simple ZenCache on low traffic sites I manage, and that seems to do a pretty good job.

    The managed hosting seems less stress and more WordPress-specific, but I’m concerned about some limitations on plugins allowed.

    Do you have any preferences re. managed versus own (shared or otherwise)?

    Cheers!

    • This is timely, as I’m currently on shared hosting but considering moving to managed, with Pressidium.

      I’ve heard good things about them, though I’ve never really used them. I was reviewing them as a potential place to which I’d like to relocate at some point, but haven’t made up my mind just yet.

      I used to use a mix of WP Super Cache and MaxCDN, then I used the simple ZenCache on low traffic sites I manage, and that seems to do a pretty good job.

      I’ve had some good success with WP Remote which I plan to review in-depth later, but I’m also a fan of MaxCDN, as well.

      The managed hosting seems less stress and more WordPress-specific, but I’m concerned about some limitations on plugins allowed.

      Understood! This is why I’m so on the fence about managed hosting as it is. For some, it’s perfect. For others, it may not suit them best.

      Do you have any preferences re. managed versus own (shared or otherwise)?

      Haha, I think I just answered that question above — give me a few weeks or so and I’ll have a post as to what direction I’ve ended up taking everything and it should answer this in great detail.

  2. Hey there mate,

    So just wanted to jump back in here. I moved over to Pressidium just before

    Christmas, and these guys were there 24/7 around Christmas Eve when the

    main migration was happening for three sites.

    I had a query about one of them (due to some CNAME issue) and they were on

    the ball within 30 minutes, taking care of it for me. Ever since, when I

    raise any support tickets, I usually have an answer within an hour.

    I’m only on the Personal Plan, but it feels like I’m one of their VIP

    customers. Seemingly, from others I’ve spoken with since, this is the kind

    of service everyone gets.

    I’m sold!

    Looking forward to seeing where you go, and the post behind it. Cheers,

    fella, and a belated Happy New Year!

    • I’m only on the Personal Plan, but it feels like I’m one of their VIP customers.

      That’s fantastic. I love hearing stories like that!

      Looking forward to seeing where you go, and the post behind it.

      Once I get all the migrations done, which will take a while, I’ll be sure to talk more about it here.

  3. Another happy Pressidium fan here. Speaking of caching I use WP-rocket on almost all my sites though on Pressidium I use it to manage combining CSS and JS and what to load async.

    I’m really a huge fan of both Pressidium and WP-rocket

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.