Cache memory is an efficient technology for saving resources by saving repetitive processing operations.
In short, it helps make websites significantly faster, which leads to results SEO, and a user experience that is better. Needless to say, also better conversions, and accordingly also revenue if your site sells services / products online.
In this article, we will go into detail about caching: what it is, why it is important, and how to install and configure it, particularly on WordPress sites. Let's get started.
What is cache memory? Original Hebrew article artwork.
What is a cache?
While the technology and exact details of caching can be quite complex, the overall idea is actually very simple. We will try to explain with an example.
If you were asked 'What is the product of 5 x 4 ?', you would know that the answer is 20.
You didn't have to do a mathematical calculation; you have done the calculation for this question so many times in your life that you don't need to do it again – you simply remember the answer to the question without putting your brain into "data processing \ calculation" mode.
In fact, this is a type of cache that we are running.
The pages of websites are usually viewed hundreds, thousands, or sometimes millions of times a month.
Normally, every time a browser asks to load a particular web page, the hosting server has to perform a whole set of calculations. It retrieves the latest posts, generates a header and footer for the site, locates the widgets that should appear in the sidebar, and so on.
But in fact, in most cases, The result of all these calculations will be exactly identical. Wouldn't it be great if we could just get the hosting server remember the final result, instead of performing a calculation for each request separately? That is exactly what cache does!
How are pages served from the cache?
In fact, it is very simple to understand how pages are served from the cache. Let's say you own a blog that has caching technology enabled.
The first time someone visits your home page, they will receive the page in the usual way: the request will be received, calculations will be performed on the hosting server, and the result will be received as a file of type HTML that will be sent to the visitor's browser.
Since cache technology is active on the site, the hosting server will save the HTML, usually in the 'random access memory' (RAM), as mentioned, this is very fast memory.
The next time that you or a visitor reach the site's home page, the hosting server won't need to perform any calculations. Instead, it simply sends the browser the the HTML the ready-made.
But what happens when my content changes?
You are probably having the following thought: All this sounds great, but what happens if the site's caching technology is active and I then publish a new post? Will the new post be left out and "hidden" from site visitors?
In fact, most of the systems that manage caching on websites today know how to handle such and similar cases.
Cache systems don't only pass on the command to save pages of HTML ready in advance, they also have a way empty the cache (and then recreate it) when certain conditions are met (such as publishing a new post, or editing an existing post).
Is cache really that effective?
Sites with properly written code load in less than 2 seconds. (Your site's load speed is a figure you can easily measure with a number of free services such as Pingdom) Isn't that fast enough? Is it really worth enabling cache technology? The answer is definitely yes.
By using a variety of types of cache technologies in parallel (browser, hosting server) you can significantly cut your site's loading time. It is definitely an effort that must be invested – but it pays off in the end.
In addition, you should take into account that using caching not only improves your site's load time, but improves the site's efficiency and performance, will cause the site to use Fewer server resources, and to be much more resilient during peak load times with several visitors at once.
to our questions – is caching really that effective? Combining and properly using a variety of caching technologies can improve the site's load time up to 280% of the original load time.
Types of cache technologies
In general, the types of technologies can be divided into 2 main topics – server-side cache on the hosting server, and browser cache.
Browser caching is done at the client level (Client Side), and caching on the hosting server is done at the server level (Server Side) and lists several subtypes of caching technologies. Let's understand the differences between the types.
Browser cache
When we visit a website, we don't need to receive only the content of the page we're viewing – we also need to receive a whole set of supporting files such as JavaScript, Css, fonts, and a variety of other files that the browser 'downloads' in addition to the page content.
Browser cache allows the browser to store these helper files for a certain period (the period is defined by a server-level setting), so there is no need to download these files on every page load.
For example, the first time you visited the uPress.co.il, your browser downloaded a whole set of files and immediately saved them in the cache.
The first time the site loads it will usually take a few seconds to fully download the files, but on subsequent visits to the site you will notice a significant improvement in loading speed.
Caching on the hosting server
In fact, we have already explained how cache works on the hosting server: instead of the hosting server having to perform calculations / process every request, the hosting server takes the result (which is an HTML page HTML) and stores it in fast memory. It then serves us the pre-stored result – which makes the whole matter of loading time much faster.
You may have come across terms such as Object Cache or Full Page Cache. These two terms are different types of cache technologies on the hosting server – Full Page Cache is the technology we talked about so far.
Object Cache stores only bits of information, the opposite of Full Page Cache. This technology is useful within server-side programming (for example PHP), and when saving a result composed of several commands or operations. For example: loading a list of widgets in a sidebar.
On the first load, the hosting server will process data and return a list of all the widgets that are supposed to appear in the sidebar, and immediately afterward the server saves the entire list in fast memory (RAM), the next times – the hosting server will load the list (which is also a piece of code, but without data processing) from this memory instead of performing additional data processing.
Caching in WordPress
In fact, there are three topics we need to be familiar with when it comes to caching in WordPress: WordPress caching plugins, writing effective code, and caching at the hosting server level.
Using cache plugins in WordPress
The law most important that you must remember, and it should be emphasized strongly – Never, ever, ever use more than one caching plugin on WordPress sites. It will not make your site faster; on the contrary – it will make your site much slower and break the process of creating cache.
It is always worth using a single cache plugin and configuring it optimally for your WordPress site (there is no blanket setting that suits all sites). This will make your site load at maximum speed.
We recommend the best caching plugin Wp-Rocket, you can use the guide we wrote how to properly configure the plugin Wp-Rocket to improve speed.
Writing effective code
This section is more suitable for WordPress developers. We will not want to get into the WordPress core in this article, but the first thing we should be familiar with as WordPress developers is – how WordPress works from the inside.
For example, if you run a function to get a single piece of data about a post:
get_post_meta( $post_id, ' thumb', true );
Behind the scenes, WordPress executes the command for all the information about the current post. This means that even if we use the command again get_post_meta() another 20 times – WordPress will not execute the command anew each time.
The second thing worth knowing is how to useTransients correctly in WordPress sites.
Transients are a type of solution – Object Caching with an expiration date (or without an expiration date).
For example, they can be used to cache the details of a request API, which is not updated frequently, except in very specific cases – in which cases we usually take care to clear the cache memory, and thus prevent requests API unnecessary ones that would return an identical response.
Using cache at the hosting server level
One of the great advantages of sites that run on managed WordPress hosting, such as uPress for example, they use improved caching technology, which adapts itself to the way WordPress works, and make them much faster and more efficient.
The cache systems of managed WordPress hosting run At a much higher level than WordPress plugins, (before the request reaches the WordPress system), which means these systems are much more effective.
If you use managed WordPress hosting to host your site, it is usually recommended not to use cache plugins at all. In most cases, companies that specialize in managed WordPress hosting build their caching systems to work without cache plugins or to work with a specific cache plugin tailored to their needs.
Usually – companies specializing in managed WordPress hosting build their caching systems to work without caching plugins or to work with a specific caching plugin that was tailored specially for these needs.
(At uPress we highly recommend using the Wp-Rocket caching plugin)
In summary
Caching is a technology that improves the loading time of sites, and their efficiency, without harming anything in the process. When configured correctly, it not only significantly improves site performance, but also reduces the load on the hosting server.
If a caching plugin is not yet installed on your WordPress site, Now is the time !
Advantages UPRESS
As part of uPress's commitment to being the provider of the fastest hosting, we invest great effort in research and development also for topics related to streamlining caching processes,
uPress servers and the sites on them work with several layers of cache in order to achieve maximum efficiency and performance.
Feel like you followed all the explanations and your site is still crawling? Maybe it's time to move to a hosting provider that specializes in WordPress sites ! We are here for any question / challenge.
