Video: WP Super Cache – Configuring Advanced Settings

Posted OnJan 21, 2014     CategoryDevelopment, Plugins, Videos     CommentsNo comment

Audio Transcript

In this tutorial, we’re going to show you how to set up WP Super Cache advanced settings.

Here you can see that we’re already in the WordPress dashboard and we’re currently in the Settings panel for WP Super Cache. So we’ve already set up the easy settings earlier. So you can check that out in our previous tutorials if you would like.

What we need to do here is click on Advanced and there are quite a few options to go through. If caching is new to you, a lot of them may be a little confusing, maybe even a little bit confronting for you. But we will try and keep it as simple as possible.

So the first setting is, “Cache hits to the website for quick access”. It’s recommended and it’s already turned on and you should definitely leave that turned on.

Next we can choose how we want to actually cache the website. It’s currently set to use PHP to serve cache files. You can also choose “mod_rewrite” which is an Apache module. So just note that this will only work with Apache.

Now you can use whichever you would like. For the most part, if this is new to you, you should use PHP to continue serving cache files. But you can also choose mod_rewrite. Mod_rewrite is definitely the fastest way to do it and it’s reasonably easy to do. So it’s up to you what you want to do. I think that’s the best though.

Now we just move on to the miscellaneous settings. The first option we have is to compress pages, so they are served more quickly to visitors. In a previous tutorial we’ve already covered compression and ideally you will already have that turned on. So if you find that, leave that on.

Alternatively you can just check the box to turn it on here. Next, we have not modified browser caching which will all return a 304 result. Now it’s disabled by default. Some hosts will have problems with it. The best thing you can do is turn it on and just try. You won’t know if you’re going to have troubles with it until you try.

So definitely consider doing it. I’m pretty confident it will work on my server. So I’m just going to leave that turned on.

Next we can choose to not cache pages for known users. It’s recommended, ideally thinking that a known user is someone who will be visiting the site regularly. So they will probably want to see the most up-to-date versions. So we can just turn that on. Again, it’s a recommended setting.

Next we can choose to not cache pages with GET parameters. So it’s probably good just to leave that off. It’s not really required because they are the requests for pages that were run less frequently than people just coming to your website and visiting posts and reading and so on.

You can then choose to make known users anonymous, so they’re served super cached static files. If you’re going to use this, you don’t really need to use the two options above, don’t cache pages for known users. But you can use them in conjunction with one another.

The next setting is regarding the cache rebuild. So it’s turned on by default and it’s recommended that you turn it on. I strongly recommend leaving it that way. Essentially what this does is that while your cache file is being generated, it will serve a super cache file to any anonymous user. So definitely leave this one on.

The next setting we have here is not really regarding the performance of the website. It just inserts a little link into your footer the same that you use in WP super cache. It’s up to you if you want to turn that on. I like to leave it off.

Now we’ve moving into the more advanced settings. We can enable dynamic caching which it needs to be used with either PHP or Legacy. It won’t actually work with mod_rewrite. So if you want to use this, you need to use PHP or Legacy.

So if you’re just leaving it on PHP, you can enable this. It’s kind of complicated to explain exactly what this is. So we’re not going to cover that in this tutorial today. You can of course check the FAQ notes if you would like to learn more about that.

Next we can choose mobile device support. Now you need an external plugin or the right theme to do that. It just shows you the various browsers and prefixes that are available.

It is on by default. You can leave it on. If you notice, you have problems viewing your website when you’re viewing it from a mobile device. You can turn the setting off and then you can try again. If it resolves the issue, you know that’s the cause.

The next setting is to remove the UTF8 charset from your .htaccess file. It’s only necessary if you see any bizarre characters or punctuation isn’t appearing as it should. You might see the euro sign where it should have an apostrophe for instance. So you would want to check that box if you noticed anything like that.

Next we can choose to clear all cache files when a post or page is published or updated. It’s optional to have that on. It will just mean that anytime you publish or update a post, it will clear the cache for you. So if you’re doing a lot of editing on already published pieces, you should probably consider leaving that off. Otherwise, it could just generate additional load for your server.

Now you can choose to initiate extra home page checks. As it mentions, it can occasionally stop the home page caching. It is very rare that this will happen though. It’s worth turning on, I think. So my recommendation is to turn that on as with the plugins.

The next setting is to only refresh the current page when comments are made. So if you’ve got a post that doesn’t have many comments, you can choose to only have that page updating the cache when there are new comments on it.

It’s not necessarily recommended but it’s not not recommended either. Again it’s one of those things you can choose to put on. I mean you can enable that and then you can run different speed tests on your website such as Google Page Speed or Yahoo’s YSlow to see if it makes any difference to your speed. But the gains from that will be minimal at best.

You can then choose to list the newest cached pages on this page. If you just like to see what’s going on, you can definitely do that. It’s just kind of interesting I think but it certainly won’t boost performance.

The next option we have is to enable coarse file locking. You don’t really need it but if you have an extremely underpowered server, it can be advantageous. As it does note there, it may cause your server to lock up although in very rare cases.

Just the last setting for the advanced options here is to enable late initialisation. So what will happen is the cache files will only display after WordPress has loaded and it’s really only useful in the instance that you’re using Legacy caching. So for most people, it’s best to leave this one off.

You’ve also got a Do Not Cache Page secret key. Basically what you can do is just add that to any pages that you don’t want cached. So if you want to view your website with fresh content, you can just add that string to the end of your URL as we can see here.

Those are all the advanced settings for caching and now it’s time to move on to expiry time and garbage collection. So you can set a cache timeout here as well. It’s always in seconds and it’s currently at 1800 seconds, which is 30 minutes.

It’s OK and you can tweak it up or down. You may wish to tweak it up if you don’t publish very often or your site is generally static in most regards. The next settings we have are for how long should cached pages remain fresh. So you can choose to set it to zero to disable garbage collection. But the default is 3600 seconds and if you just go down here, it’s currently scheduled to 600 seconds. So we can change that there.

Alternatively, you can use a clock and choose to do it on an interval of once hourly, twice daily or once daily. For most people though, just leaving the time set to 3600 is absolutely fine.

The final setting regarding garbage collection is you can actually request an email when garbage collection runs. You can do that in the instance such that if you have a very high traffic website and it’s crashing at certain times, it may be when the server is trying to perform garbage collection. So you can turn emails on and then if you look at the time, you’ve got the email and then the time your server may have gone down.

You can reasonably deduce that that may be the cause. So it’s optional but if you’re troubleshooting, it’s very useful.

Finally, we can choose the accepted file names and rejected URLs. So this is about not caching certain pages. So basically you can just choose single pages or single-post pages, front page, the home page, archives, the feeds, search and author pages as well.

It’s mostly safe to just leave all of these cached. If there are any particular that you would like to not cache, this is where you would do those settings.

So when you actually go through here and modify any settings, what you need to do is do it section by section. So we’ve made some changes to the very first section, the prominent caching settings there. So we just click Update Status now.

As you can see, it says the rewrite rules required by this plugin have changed or are missing. Scroll down to the advanced settings page and click the Update Mod_Rewrite Rules button. So we can do that right now.

So scroll down and you could see “Mod_Rewrite Rules”. So we need to basically put all this into the .htaccess file. We can edit those by making these changes ourselves. We can scroll down and just we should be able to tick that and in doing so, we will actually make those changes for us. It goes green to indicate that it has all been taken care of.

Next, we can change the expiry time and garbage collection settings as we did before. So we will just change that time and set it to 3600 as we did before and definitely enable emails for this and we can just change that expiration. That has been updated. That’s all the changes that we need to make now because we didn’t actually make any changes here. So we don’t need to save that.

But that should hopefully give you an idea of how you can use WP Super Cache on your website. It can definitely help drastically speed up your website and moreover, can definitely help your server cope in times of extreme load. If you have any questions about caching or WP Super Cache, please ask in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *

Send this to friend