How web caching works (and what kind you need)

Olly .

Online, speed is everything. Nobody likes waiting for pages to load, and if you don’t want to lose people, every millisecond counts. Which is where caching comes in. It helps your site serve up pages sooner, protecting its performance, safeguarding its scalability and helping it handle more traffic. So how does caching work, and what kind do you need?

 

What is website caching?

It’s a way of serving up web pages faster. Whenever someone visits your site, their browser asks your server for the data it needs to display each page. Hopefully, that happens quickly. But spikes in site traffic or extra load on your server can slow things down, so pages take longer to appear. By copying and temporarily storing your website the first time it’s loaded, caching enables it to be remembered and served up faster, without the visitor’s browser making a new request to your server. The result? People see your pages sooner, and there’s far less pressure on your server.

 

Why is caching so important?

For every fraction of a second your page loads are delayed, you’ll lose visitors. People don’t want to hang around, and can be less likely to trust slow-loading sites. Worse, slower page speeds can affect your Google rankings, meaning fewer visitors actually find you in the first place. Improving your site’s performance, resilience and scalability can be done in other ways, but they’re often complex, long-winded and expensive. Caching is a quick, easy, inexpensive (or sometimes even free) way to make a big difference to people’s experience of your site, boosting searchability, sales and loyalty. It’s pretty much a no-brainer.

 

What kinds of caching are there?

There are three main types of caching: site caching, browser caching and server caching. So what’s the difference? Well, what it comes down to is where those copied pages are stored, and how much control that gives you over improving your site speeds. Let’s take a closer look…

 

Site caching

Site caching is almost entirely controlled by the end-user, with pages saved on their system, not yours. It helps them see the sites they want to see, faster, making life easier for them. While that helps you as a website owner, it’s not something you have much say over.

In fact, the only element of site caching you can control, is telling the cache how long to store saved data before making a fresh request from your server. You can set this in the HTAccess file, or if you have a WordPress site you can download a plugin. If parts of your site are static and will rarely ever change, you can make those expiry periods pretty long, saving your server from unnecessary requests.

On the other hand, if parts of your site will be updated regularly, you’ll need to set shorter expiry periods for those elements. Otherwise, even if you’ve updated a page, your visitors might still be served up the older version saved in their cache.

 

Browser caching

Browser caching is similar to site caching, in that it mostly happens at end-user level, and is mainly in their control. It’s a cache system that’s built into their browser, storing content like HTML pages, CSS stylesheets, Javascripts, images and multimedia content on their computer.

Every browser has some kind of cache, although some are more advanced than others. End users can also decide to clear out their browser’s cache whenever they want to, although many won’t be aware of this, or feel the need to do it.

In the same way as site caching, the only control you have as a website owner is how long pages are cached for. Again, if pages are static, you can set the cache to last for fairly long periods, but any content that will change regularly will need much shorter cache expiry times.

 

Server caching

With server caching, everything’s saved on your own server, instead of with the end user. In fact, it’s completely handled at your end, giving you much more control. Content, code, queries and data can all be saved in your server cache, and you can update it anytime you make changes to any part of your website. No need to wait for pre-set expiry periods to end. 

When someone visits your site, your server will check whether the page they want is stored in your temporary cache. If it is, it’ll be served up straightaway, for a smoother user experience.

For website owners, it’s one of the easiest, most effective ways to reduce pressure on your servers, help your sites handle more traffic, and reduce the risk of losing visitors to your competitors. It’s also an inexpensive (or often free) system to get set up.

 

How do I set up caching for my site?

At Nimbus, we love Varnish Cache, a super-speedy caching system designed to give Magento sites superpowers. If you’ve got Magento 2.3 or 2.4, it can cache your static and dynamic content, taking most of the load off your servers. As a result, it can make your sites up to 1000x faster, as well as boosting your server performance. Which means a better shopping experience for your site visitors – driving conversion, sales and repeat visits. Even better, you can get Varnish Cache fast and completely free if you’re on one of our STORM Oxygen hosting packages or above.

 

You can take a closer look at Varnish Cache here and find out how to get set up, fast.

 

Don’t worry if you’re not running on Magento, we’ve still got your back. Cloudflare is another amazing caching system designed to boost site speed. It’s also free if you’re on STORM Oxygen or above, and you can find out all about Cloudflare here.

 

Like to find out more about hosting, caching and making your websites work even better? Just raise a ticket, drop us a line or give us a ring on 0203 005 9181. We’d love to help.

.
Nimbus Hosting
1 Centrus, Mead Lane Hertford Hertfordshire SG13 7GX GB 0203 005 9181 [email protected]