Getting information around the web takes processing power and time. The data needs to travel from one server to another. Using caching cuts down on this time and resource usage.
Answering what cache is depends on the context. On the whole, a cache is a way to save and quickly recall frequently used data. Managing your cache, especially when using WordPress, can be the difference between a smooth, fast-running site and a frustratingly slow site.
This post will answer the question “What is cache?” and provide some insight into how to manage yours.
What Is Cache?
Cache takes data processed by an app and stores it for later use. It doesn’t have to be in the browser per se, but you’ll find websites and their underlying technology use cache a lot. “Caching” is the term for the process of storing and recalling the saved data.
Cache often includes two elements:
The caching software itself runs the process and shuttles it between the various other elements.
Random Access Memory (RAM) and “In-Memory” engines. They store the data passed by the caching technology.
These elements have to be high-quality and collaborative. Slow-performing RAM won’t be able to recall the data quickly enough for the software to use it efficiently.
A cache is almost necessary for most web applications, given how large page file sizes are. A solid implementation can give you precious seconds back in some cases. A user who remarks that a site loads fast gives an indirect compliment to the caching software at the heart of the website’s server.
We’ll go into more detail on this next.
How Cache Can Help You Optimize Websites
Computer technology is constantly expanding. In other words, memory, hard disk space, and other such computer processing elements are increasing in size at a rapid rate. Long gone are the days of 64 KB of RAM in our personal computers; it’s typical now to see Gigabytes (GB) of RAM on tap. Some of the more recent Apple MacBooks can even fit 64 GB of memory.
Websites are also becoming heavier due to the demands modern web development and related technologies place on-site code. It not only requires more processing power for an end-user — it also needs a more robust server and the technology to accommodate. Without memory (and caching), the loading speeds slow to a crawl.
As such, Search Engine Optimization (SEO) has long recognized that page speed is a primary factor for ranking websites. While the exact details aren’t known, the ranking factors that go into the placement of a site in the Search Engine Results Pages (SERPs) include references to site speed.
While ranking metrics won’t use site speed as a direct measurement as you’d imagine it — there are too many factors in play to use it as a reliable metric in itself — lots of other aspects take it into account. For example, the quality of your site’s HTML code and the loading times from within Google Chrome have an impact as well.
Regarding User Experience (UX), a longstanding metric states users will abandon a page after only two seconds’ wait. It brings up a few issues:
Your Google RankBrain optimization — which includes bounce rate — needs to be spot-on; your SEO efforts are dead in the water otherwise.
A faster site loading speed will help keep your bounce rate in check.
The UX of your site is one of your site’s most critical elements.
Caching can help in all of these areas by reducing the time it takes for your page to load. What’s more, the resources your site uses will be lower, further having an impact.
On the whole, a site that loads fast with the most relevant and up-to-date information will perform better than the rest.
Next, we’ll look at some of the problems you can run into with caching.
How Caching Can Sometimes Cause Problems
Of course, it’s not always bells and whistles with caching. The main concern is implementing a cache that works too well. A large and frequent caching cycle isn’t necessary for many small sites (or at least non-enterprises or networks). It can see your server waste resources caching pages that haven’t changed.
On the flip side, a strategy and implementation that doesn’t cache enough (or in the right way) can see you serve an outdated page. This issue can sometimes happen with WordPress websites. However, there are tricks and tips to overcome it.
Of course, serving an older, cached version of a page can cause problems. Consider a pandemic resource site that has to update its information regularly. Now consider how inadequate or non-existent browser caching could impact the page.
The good news is that getting caching set up to mitigate or lessen the impact of these drawbacks is straightforward. We’ll get into this later on.
Website Technologies That Use Caching
We’ve already noted how caching is involved in several different ways across computing in general. Though, in this article, we’re looking at non-CPU caches. If you check back at the Apple MacBook specs, you’ll notice there are often a few megabytes (MB) of caching included in the processing chip:
This caching holds for mobile devices too.
But we’re looking at caching that uses servers in some capacity. Here’s some of the different technology we’re talking about:
Browsers. A browser cache is the first thing you’ll think of when it comes to technology. It stores regular requests in the cache for faster loading on the next call.
Devices. While the CPUs themselves are beyond the scope of the article, the browsers and apps on the device will often use the storage and RAM to cache data.
Apps. Yes, the apps can also have a cache to store oft-used data. Again, this is going to use on-device storage that isn’t the CPU to cache data.
Servers. Another everyday use for caching. Some of the server data that shuttles around can be stored and recalled for faster execution and processing. An example of this is the Redis cache.
Domain Name Server (DNS) caching. A focused application for caching. The machines involved here do nothing but cache data, so the front-line servers can shuttle data while the DNS caches ensure a smooth operation.
Before we move on, it’s worth pointing out a few points on related technology to caching. For example, you may consider that storing cookies is similar to caching web pages. In many ways, this is true. For example, cookies are stored on your computer after being triggered by the browser. The difference here is that cookies store information about you and your usage rather than the page state.
A Content Delivery Network (CDN) represents murkier waters because it does the same thing as caching on paper. CDN stores the whole website as a set of static files rather than working with the site directly. As such, while it has the hallmarks of caching on the surface, it’s a different way of storing and delivering websites that still need caching to run fast.
Some CDNs like Cloudflare take care of both aspects (plus more), which is why Kinsta has selected them to make our client sites faster and more secure.
How WordPress Handles Caching
Despite our love for WordPress, it’s not the fastest platform around. If you’re using WordPress for your site, you’ll need to employ caching to help serve up a rapid experience. Your site speed is a joint effort between you, your host, and your choice of caching plugin.
If you’re a Kinsta customer, you don’t need a caching plugin of any kind. We automatically provide four different types of caching at the software and server levels:
We’ll cover all of your bases and make sure that your site is optimized speed. For customers of other hosts, though, a dedicated WordPress caching plugin will likely be an excellent addition to your setup.
There are many solutions available in the WordPress caching plugin arena, and having to make a choice could be overwhelming. Let’s take a look at some of our favorite options.
We already have different types of server-level caching implemented, which is much better than any plugin can do on a PHP level. Hence, some of the plugins listed here aren’t compatible with Kinsta hosting. Check this section for more info and this full list.
WP Super Cache
The most straightforward option is to choose Automattic’s WP Super Cache:
It’s considered the “official” WordPress caching plugin. It serves static HTML files in place of your dynamic PHP files (which is what almost all of your visitors will see, all without experiencing any loss of functionality).
What’s more, the plugin includes “preloading,” “garbage collection” (removing cached items that are no longer required), a CDN, and REST API endpoints for developers. It’s a solid entry point to caching plugins and could be all you need.
W3 Total Cache
W3 Total Cache has been on many users’ install lists for a long time:
It’s billed as a “Web Performance Optimization (WPO)” framework and claims to be agnostic to the choice of the web host. It’s packed with features and functionality, but it’s notorious for being overwhelming to new users. W3 Total Cache has many features, but you need the time to use it most optimally.
There are also simple caching plugins that perform better than the leading contenders in the eyes of some users. For example, WP Fastest Cache and LiteSpeed Cache both have rave reviews and simple dashboards.
When it comes to premium plugins, WP Rocket rules the roost:
It’s a high-performing plugin that’s also easy to use. It applies a bunch of best practices and has over 1.5 million users. WP Rocket is also compatible with most WordPress products and services, including Kinsta.
Sign Up For the Newsletter
How to Install a Caching Plugin
As for installing a caching plugin, the process is straightforward and is the same as any other WordPress plugin. Caching will be enabled upon activation, and there will often be a dedicated panel to handle how the plugin caches your site. For example, you can locate WP Super Cache’s options in the Settings > WP Super Cache panel:
Your particular plugin will have different settings depending on its complexity and goals. A solution like WP Super Cache is deceptive. It appears simple on the surface, but as the Advanced section shows, there’s a lot under the hood to tinker with:
Our advice is to stick to the simple options if you’re unsure of what a particular setting does. Most caching plugins have quick-to-set options for different caching setups. For example, WP Super Cache uses Simple or Expert caching:
The main difference is that the Expert mode uses Apache’s mod_rewrite option to serve cached files. Though, for a user who doesn’t know the inner workings of how files are cached, the Simple delivery method is acceptable.
How to Clear Your Cache
One of the more common needs is knowing how to clear your cache. As you may expect, there are a few ways to do this, depending on your device or browser. We’ll take you through the various approaches, starting with your desktop browser.
Clearing Your Browser’s Cache
By far, the most common relationship an end-user will have with caching is within the browser. Clearing that browser cache is a tried and trusted way to get things working again if there are issues. As such, it’s a method often presented as much as turning something off and back on.
Each browser will have a dedicated preferences screen to give you access to the cache to various degrees. For example, you can find Safari’s cache in its Preferences pane, under the Privacy > Privacy tabs:
In contrast, Firefox has a comprehensive set of features within the Privacy & Security section of its Preferences, in keeping with its placing as a privacy-focused browser:
For most Chromium-based browsers such as Google Chrome, Brave, and others, the cache is in the same place. Using Brave as an example, it’s in the Additional settings of the Preferences, under the Privacy and security section:
In contrast, Chrome puts the options front and center in the settings:
When it comes to Microsoft Edge, the cache is in the Privacy, search, and services section of the Settings, under Clear browsing data:
Tired of subpar level 1 WordPress hosting support without the answers? Try our world-class support team! Check out our plans
The good news is that clearing a cache is often a case of clicking once and waiting for the browser to do its thing. Most browsers will let you select the data you want to clear from the cache, so this, of course, will increase your “click count” if you have specific requirements.
Clearing a Device Cache
Your smartphone and computer also have a cache because they too need to store data to recall at a moment’s notice. As you’d expect, each Operation System (OS) and platform has a different way of handling it. For instance, on the Mac, you’ll head to the ~/Library/Caches/ location within macOS:
Once here, you’ll notice the cache is a collection of files that you can drag to the Trash:
As for Windows 10, there are a few different caches found across the OS. We’re jumping the gun a little, but to clear the DNS cache, you’ll need to run the Command Prompt as an Administrator:
From here, enter ipconfig/flushDNS. Once you run it, Windows will flush the DNS cache:
You’ll also find Linux distros use the Terminal and command line to clear system caches:
Mobile devices don’t often have a central cache to clear like desktop machines. As such, you’ll have to get the job done piecemeal. Apple iOS is the most “fragmented” of devices here, although Android does a better job.
Clearing a DNS Cache
We’ve already touched on server and DNS caching, especially regarding clearing the Windows 10 DNS cache, but we haven’t talked about clearing it for other platforms.
For the unaware, the DNS cache stores all of the most recent attempts to connect to the internet, specifically its domain names. In other words, it’s a list of DNS lookups the computer uses to figure out how to connect to the internet.
It’s different from other caches on your device but could have some cross-over. Before you get into clearing the DNS cache, you should have three things in place:
Admin access to your computer or device.
Access to the Terminal, Command Prompt, or Command Line.
Skills necessary to use the Command Line Interface (CLI), although you don’t necessarily need to know the exact commands to use.
Of course, when it comes to the last point, we’re here to help. We’ve covered clearing your DNS cache on a per device basis elsewhere on the Kinsta blog. We suggest you check out that article for the juicy details.
Clearing the WordPress Cache
When it comes to WordPress, there are a few places you can head to clear the cache. The platform itself doesn’t hold a cache. Instead, there are two touchpoints to consider:
Your hosting provider’s options, sometimes found within WordPress.
Your dedicated caching plugin.
Depending on your choice of host, you’ll have an option within your control panel, within a plugin installed within WordPress (dedicated to your host’s server-side caching), or both. We’ll discuss this in more detail further on.
In addition, you’ll often have a dedicated third-party plugin in place to help cache your site, and you’ll find the option to clear it within the relevant settings or preferences screen.
How you access this will depend on your plugin (and we’ll cover some options next). For example, WP Super Cache displays the option both on the toolbar and the Settings > WP Super Cache page:
For W3 Total Cache, you’ll again find the options you need in the toolbar at the top of WordPress:
For most plugins, the takeaway is that the option to clear the cache will be within the toolbar (or labeled). As for your host, you’ll typically find the option to clear the cache in two places: the WordPress dashboard if there’s a plugin involved and your hosting control panel.
Some hosts help WordPress users by adding specific options to the WordPress admin through a plugin. In most cases, these act in a similar way to third-party caching plugins. Though, the best approach (in other words, the one you know will work) will be to head to your hosting control panel and look for your caching options.
In MyKinsta, for instance, you’d navigate to your site from the Sites screen, then head to the Tools tab. Here, you’ll see the Site cache option:
The one-click option will clear your cache on the server-side, leaving you with nothing more to do. You’re now free to get back to running your site while we can keep serving it.
Websites need to run fast. The most performant way to do this is through caching. It’s a way to store the data that is often pulled and pushed between servers. Once saved, browsers can recall it in a split second, making your website load quicker and keep you on the right side of SEO.
A solid host will have server-side caching in place and do all it can to make sure your site uses it to its most optimum. What’s more, a good plugin will make your site run even faster and make sure caching helps every aspect of your site.
For the end-user, caching is a simple technology. For those who dig deeper, it’s something worth spending plenty of time on, as your performance relies on it.
Do you utilize caching, and if so, what is your go-to “stack”? Please share your thoughts and opinions with us in the comments section below!
The post What Is Cache? Learn This Common and Complex Technology appeared first on Kinsta.