WP Super Cache Settings are important to the caching of your website. Caching your website will help your site load faster on several different types of browsers. If you want to know how to clear your cache in different browsers please see our articles, "#what-is-cache" target="_blank" rel="noopener noreferrer">How To Clear Your Cache". This article is about the settings using the wp-super cache plugin for WordPress. You can download wp-supercache here. Remember there are different types of cache.
- Computer Cache
- ISP Cache
- Browser Cache
- Search Engine Cache
- Website Cache
Why Website Speed is Important
Website speed is important because algorithms are now considering speed when they place you in a search engine rank. So if you have a great article about a certain subject and you have a a very slow website then an inferior article might be placed above you in the search engines thereby costing you valuable visits.How Does WP-Super Cache Work?
There are 2 words to remember, "Static" and "Dynamic". A "Static" webpage is much faster because it does not have to generate dynamic content. Think of "Static HTML" as a piece of paper with some writing on it. All you have to do is walk over and pick it up and look at it. The print and ink on that piece of paper is "Static". "Dynamic" means that there has to be some work done in order to generate a visualization of content. Think of this like your TV remote. You click it on, the monitor warms up display some light and you are able to see an image. This is done by the TV accessing data resources. How does this relate to WordPress and WP Super Cache? Think of super cache turning your TV data into a piece of paper that you go over and pick up and be able to see any image that the TV dynamically displays. That is how WP Super Cache works for most of the dynamic content that is on your website. Now you know what static files are. It is important to note that these "Static Files" are served to your visitors that are NOT logged in or have NOT left a comment. Why? Because if you leave a comment or make a change on your website you want to see the new fresh content. Being served a cached file of the content means that you might not be seeing the freshest content on your website. That leads us to garbage collection that we will be talking about more below in the settings.WP Super Cache Settings Step #1 Picking the Type of Cache to use
After you download, install and activate WP Super Cache the next thing that you will have to do is enable the caching of your website. By default the setting will be "legacy page caching". This is the safest but slowest setting. The second fastest is PHP caching and the fastest is mod_rewrite.- Legacy Page Caching - Slowest
- PHP Caching - Faster
- mod_rewrite - Fastest
Why is mod_rewrite the fastest?
It serves super cached static HTML files. It bypasses any dynamic processing brought about by PHP. It uses the .htaccess file on the Apache server to process all the content by using mod_rewrite. You have to make sure that mod_rewrite is enabled before using this feature. You will know if you have mod_rewrite if you have "Pretty Permalinks" those are the kinds of links that generate urls with the title of your articles in them. Otherwise you will get a URL is p-101 at the end of www.whatevr.com/p-101.php The php setting is almost as fast and its easier to configure than mod_rewrite. Until now you had to guess what to so, I am going to show you the best settings for mod_rewrite and tell you why. Here are the recommended settings for php cache.PHP Cache Recommended Settings Enable the following:
- PHP caching
- Compress pages
- Don't cache pages for known users
- Cache rebuild
- CDN support
- Extra homepage checks
Step #2 Advanced Settings Tab
So now click on the "Advanced Settings" tab. Make sure that you tick "Cache hits to this website for quick access". Also tick the box beside "Use mod_rewrite rules to serve cached files. Imitate all the settings that I have checked below.Miscellaneous Settings
Compression is disabled by default because some hosts have problems with compressed files. Switching it on and off clears the cache. Warning! 304 browser caching is only supported when not using mod_rewrite caching.Advanced Settings
(Recommended) DO NOT CACHE PAGE secret key: 5454545454544iguvguv Finally do not forget to click on the update status button. You may be required to update the "Mod Rewrite Rules", go ahead and click on the button if the plugin is asking you to do so.Mobile Browsers
2.0 MMP, 240x320, 400X240, AvantGo, BlackBerry, Blazer, Cellphone, Danger, DoCoMo, Elaine/3.0, EudoraWeb, Googlebot-Mobile, hiptop, IEMobile, KYOCERA/WX310K, LG/U990, MIDP-2., MMEF20, MOT-V, NetFront, Newt, Nintendo Wii, Nitro, Nokia, Opera Mini, Palm, PlayStation Portable, portalmmm, Proxinet, ProxiNet, SHARP-TQ-GX10, SHG-i900, Small, SonyEricsson, Symbian OS, SymbianOS, TS21i-10, UP.Browser, UP.Link, webOS, Windows CE, WinWAP, YahooSeeker/M1A1-R2D2, iPhone, iPod, Android, BlackBerry9530, LG-TU915 Obigo, LGE VX, webOS, Nokia5800Mobile Prefixes
w3c , w3c-, acs-, alav, alca, amoi, audi, avan, benq, bird, blac, blaz, brew, cell, cldc, cmd-, dang, doco, eric, hipt, htc_, inno, ipaq, ipod, jigs, kddi, keji, leno, lg-c, lg-d, lg-g, lge-, lg/u, maui, maxo, midp, mits, mmef, mobi, mot-, moto, mwbp, nec-, newt, noki, palm, pana, pant, phil, play, port, prox, qwap, sage, sams, sany, sch-, sec-, send, seri, sgh-, shar, sie-, siem, smal, smar, sony, sph-, symb, t-mo, teli, tim-, tosh, tsm-, upg1, upsi, vk-v, voda, wap-, wapa, wapi, wapp, wapr, webc, winw, winw, xda , xda-
Step #3 Garbage Collection
Now we need to schedule the garbage collection. Basically It takes out the trash or old static files and replaces them with fresh static files. The fist line with the time and date in it will give you your server time and date. If this number does not read the same as on your computer you can change it it in general settings in WordPress. By looking at the second line you can see when the next garbage collection is scheduled. You can see and example of this below. In the garbage collection settings you can disable a cache time out by entering a "0". Since you are here you probably just need to imitate what we have set up. As a starting point for mod_rewrite it is recommended that you set the timer to 3600 seconds for stale cached files. Basically when a visitor loads that page and the program sees that that page is old and expired it will generate a new fresh page for your visitor. You could also use the clock to check for stale cached files so that it check it the time of day that you want it too. This would be helpful if you have a very large site and you set this to a time of day when you have the least visitors. You can slow choose to have garbage collection done once a day, twice a day, weekly, monthly or even hourly. One thing that you can do is have your server email you when garbage collection runs. This get's irritating after a while but you may want to enable it to make sure that it is working. You can always come back and disable it late. It will operate off of the email address that you have in your general settings.Expiry Time & Garbage Collection
UTC time is2014-09-06 16:29:09
Local time is 2014-09-06 12:29:09
Next scheduled garbage collection will be at 2014-09-06 17:29:09 UTC
seconds | ||||||||||
How long should cached pages remain fresh? Set to 0 to disable garbage collection. A good starting point is 3600 seconds. | ||||||||||
Scheduler |
|
|||||||||
Email me when the garbage collection runs. |
Step #4 Accepted Filenames & Rejected URIs
Lets say that you have set your garbage collection for 1 week but you update your featured page every day? Well you would not want to cache it because you want the freshest dynamic content on that web page. This is where you would choose NOT to cache certain files. Just leave them all unchecked if you are not sure. ;-) Do not cache the following page types. See the Conditional Tags documentation for a complete discussion on each type.String Explanation in WP Super Cache
For this next section it is important that you understand the difference of s string from a filename. Below you will see a string from A1WEBSITEPRO.COM. This string leads to a file name ultimately. The string is highlighted in yellow and the file name is highlighted in light blue. https://a1websitepro.com#000000; background-color: yellow;">/uploads/2014/01/#000000; background-color: lightblue;">website-speed-test-637x372.jpg Below you will see a box and in it you will see "wp-*\.php". What this is saying to the WP Super Cache plugin is NOT to cache anything that has "wp-" in a string that ends in .php. It is also telling the program not to cache any string that has the term "index" within it that ends in .php. So that means that any files that are in these strings will NOT be cached! Diving a little deeper into this. Lets say that we made a post and we gave it the category "Super Cache" but we also gave it a category of "Fast Website Methods". Lets say that we entered /super-cache/ "this would be the slug or string to that category. Although the plugin would not cache the Super Cache sting it would cache /fast-website-methods/ thereby caching your post into one category but not the other.Rejected User Agent String Settings
Ok so now you know that when people are coming to your site and accessing different pages and strings those pages are cached as they surf. Now what about a bot that is coming to your website and accessing everything on your website within a relatively short period of time. What is the problem with this? They create too big of a cache file. You can tell WP Super Cache NOT to cache pages caused by the bots. For example if you have an events calendar on your website that goes back forever and forward forever these bots will try to cache every page causing a bloated cache file.Lock Down
This is something that you will probably not have to worry about that much but what it does is lock's down your website if you are getting too much traffic.Directly Cached Files
Ok so lets say that you are going to be featured by a large website or magazine and they are going to send a bazillion people to your web page in one day. Put that url in this white box before that day and click the submit button. Now you will be ready for visitors to blast that page.Fix Configuration
If you get totally lost or mess something up then you can restore the default configuration by clicking the button.Step #5 Setting up the CDN in WP Super Cache
CDN is an acronym for Content Delivery Network. If you do not set this up right you can break your website. Click on the tab that says CDN.Off Site URL
Next you are going to enter the URL that will be your content delivery network provider like http://a1websitepro.wpengine.netdna-cdn.com or another example https://cdn.yoast.com. Basically this is the website that is going to download all your identical content and server it for you.Include Directories
So now that you told the plugin that you have a CDN you have to let it know which files you are going to let the CDN handle and which files that you want the plugin to handle. You can do that by letting the plugin know the directories or folders that you want included in the static file matching.Exclude Substring
So lets say that you do not want something to be a part of your CDN because you are having problems getting it to load like a flash. You would put php.,flv in the box to exclude all flv files but if you only wanted it to do one you can do something like this: .php. mymoive.flv and enter that into the box.Additional CNAMES
Ok lets say that your CDN has a few names that they use to serve your content. You would enter those urls here like: http://cdn2.a1websitpero.com, http://cdn2.a1websitepro.com, http://cdn3.a1websitepro.com. Notice that you use a comma "," to separate the CNAMES or URL's.Step #6 Monitor Cached Contents
You can monitor and see how many pages are cached on your website by clicking on the contents tab. This will let you know how many cached pages that you have and how many are expired. You can then delete the entire cache by clicking on delete cache button. You can also delete only the "expired" pages by clicking on "Delete Expired" button.The expired cache
One of the things that you might want to understand that if a cache is expired it is still good. If you set you cache to expire every 3600 seconds and 5000 seconds later its expired it is still good and browsers will use those resources. However they will refresh when the garbage collection comes to clean out the expired cache that is in the cache folder.Step #7 Preload WP Super Cache Settings
Now this is where a lot of the magic happens folks. You want wp super cache to preload your files so that your visitor does not have to wait any more than they have too. Remember the illustration of the piece of paper and a TV remote? Well we we preload the cache we have those pieces of static html ready and waiting for our visitors when they come to our website. This very page that you are reading was cached the exact same way! Make all your settings like the ones below in the graphic. We have the program us email us at first to make sure the preloader is working. You can always come back and disable that feature so you do not get bombarded with emails. You will know if the program is currently working if you see the button titled cancel cache preload. As a side note your can do a speed check before and after to see how much wp super cache has sped up your website. you may also want to resubmit your website in GOogle webmaster tools as well as Bing webmaster tools when you have completed the preload process. Remember you read it here first! ;-)Step #8 Plugin settings in WP Super Cache
If you have been around WordPress for any length of time you will know that you can take great advantage of plugins. How do you get wp-super cache to cache those files? Unless your an experienced developer, you don't. For those who are you need to make another folder and keep your cached files for the plugins that you program there. WP Super Cache has provided a way for some popular plugins to take advantage of lightning flash cache. By enabling these they will load before any other plugin loads from your WordPress CMS. Simply tick in the box of the plugins that you have installed to take advantage of having a static plugin load quickly for your visitors.Step #9 Debug WP Super Cache
If you have every tried to switch a WordPress site over to another server,and had problems with it trying download a zip file, it could be because of the wp super cache plugin. We know that the plugin generates a cached version of the webpages in order to keep it quick. If things are not set up properly you could have it trying to download a zip file and this is a tale tale sing that things are messed up in the wp-config.php file. If you are having this or another problem it is a good idea to debug. Click on the debug tab and you will see the screen shot below. Follow these instructions.- Tic on the Debugging enabled box
- Enter your IP address. the program automatically shows your ip address right there, you can see that mine is 162.233.120.73
- Next tic the box and enables comments at the bottom of every page that will create cache status message.
- Now tick the box under advanced where it says "Check Front Page Every 5 Minutes"
- Enter a phrase that is found on your front page, a phrase that I find on my front page of course is web development.
- Tic the box that says clear cache on error, that will clear the cache is the above phrase is not found!
- You can also tic the box that says to email you when the checks are being made.
- Make sure that you click the save button.