Caching

For efficient server traffic and fast websites.

The speed of your website is crucial for a good user experience. Therefore, it is important to keep the load on your resources, such as RAM, disk space, CPU and network, to a minimum.

For this, there is a clever way to use your server and network as efficiently as possible while maintaining the speed of your website: caching.

  • Minimal load on your server and network
  • Makes slow websites faster
  • Optimal user experience on your website
Managed Cloud services Managed Cloud services
What is caching?

What is caching?

Caching allows you to temporarily store data so that they can be accessed faster. By storing temporary copies of a website, the computer no longer needs to regenerate the data. This makes the website faster.

The benefits of caching

The purpose of caching is to make websites and web applications load faster. Fast loading times and an optimal user experience are therefore the main benefits.
As fewer resources are used, your website will be more stable in the event of large traffic peaks.
A faster website also helps improve the SEO (Search Engine Optimization) of your website.

Why is caching so much faster?

  • A cache uses fewer server resources than the website or application it is trying to speed up.
  • A cache stores content in a fast and scalable format.
  • Most caches use RAM. This type of memory is extremely fast, for both reading and writing data.
  • Due to their inherent simplicity, caches contain very little intelligence, thus limiting the load.

How does caching work?

When an Internet user wants to visit your website, a request is sent (via the Internet) to your server to display the content of the page. This request must be processed and imposes a certain load on RAM, disk space, CPU and network. This causes delays in returning the content.

Caching helps reduce this delay by temporarily storing frequently requested data in a different location and in a simplified structure. Since these data are stored separately, they no longer need to be requested from the server when the website is visited again. This ensures that the page is displayed much faster.

What is caching?

What if the data in the cache are expired?

The copy of your website that is stored in the cache is not automatically updated when changes are made to your website. It is therefore possible that your visitor will see expired web pages. This is particularly problematic if the content of your website changes frequently and quickly, e.g. for news websites.

The cached copy has a limited validity anyway. You can usually set this caching period yourself. The more frequently you make changes to your website, the shorter the data should stay in the cache. Once the cache validity has expired, the application will have to request the data from the server again.

How can you remove expired data from the cache?

When the source data are edited while they are still in the cache, the application must remove the items in question from the cache itself. In most cases, this is done in the logic executed when adding, deleting or editing the source data. The application then looks for the right location in the cache to remove the items in question.

This explicit action prevents websites or applications from displaying output that is no longer valid.

Would you like to find out more about how caching works and its benefits?

What type of data can you cache?

In principle, you can cache any type of data. But for the cache to work efficiently and to avoid extra complexity, you should use caching to store data that is very resource intensive to compute:

  • Results that require a lot of computing power
  • Computations that require a lot of RAM
  • External data that may be sensitive to network delays
  • Data requiring large amounts of disk space

In concrete terms, these data are usually:

  • The output from databases
  • The output from external web services
  • Entire web pages
  • Internal data and objects
  • Data from files on the disk

The different types of caching

All computer systems automatically cache data. Even when you load files from the hard disk, the operating system will keep parts of the file in RAM. Database systems do the same. Unfortunately, the operating system does not know the context of your application and specialised caching systems are thus required to achieve the desired result.

Combell offers the following caching systems:

Varnish
Varnish

An HTTP cache that caches entire pages. Works out of the box for static web pages. The integrated VCL programming language makes it possible to create rules for caching dynamic and personalised pages. Combell offers Varnish configuration templates for popular platforms such as WordPress, Drupal and Magento.

Learn more about Varnish
Redis
Redis

A distributed key-value store that can be used to store temporary data. It is known for its speed and flexibility and needs to be accessed from the application. Platforms such as WordPress, Drupal and Magento offer integration options for Redis to store dynamic data.

Learn more about Redis
OPcache
OPcache

An integrated cache that reads PHP files, compiles them and stores them in memory as machine code. Enabled by default with your Combell web hosting package, which means that no technical knowledge is required. Immediately improves the overall performance of your PHP code, but only has an indirect impact on the loading times of pages.

APCu
APCu

A local key-value store that is part of your PHP installation. Enabled by default with your Combell hosting package. Also offers integration options with the most common frameworks and CMSs. Comparable to Redis, but with fewer features.

When to use which cache?

Each type of cache has specific objectives. It makes no sense to enable all the caches at once. That does not guarantee better results and also increases the complexity of the system.

Select the right type of cache

  • Is your application written in PHP?

In that case, you should enable OPcache. With Combell, OPcache is enabled by default for our web hosting customers.

It is recommended to cache as many entire web pages as possible. And for this, it is best to use Varnish. Static pages or pages with few personalised elements can be cached very easily using Varnish. Varnish also offers numerous integration options with CMSs and frameworks.
Varnish also includes a programming language, which can be used to determine what must be cached and what must not.

Some pages cannot be cached in their entirety because they contain personalised elements. Just think of the online shopping cart or the checkout process of a web store. These pages are unique per visitor. However, some data from these pages can be cached, which reduces the load on the database or the file system.
Do you want to retrieve data from a database, a file on the disk or via a web service? If so, you should enable Redis or APCu.

Are the data only used by PHP?

If so, APCu will suffice. The application code will still be executed, but access to certain data will be cached.

Do other systems also need to access the cached data?

In that case, Redis will be the most suitable caching technology. Redis offers advanced data types, more commands, as well as the opportunity to control the behaviour through LUA scripts.

Depending on your CMS or framework, there may be ready-made integration options for Redis or OPcache.

Combining caches is possible, but make sure you do not overdo it. Because you might then display expired data. Be sure to clear the caches when the source data are updated.
Each caching system can determine how long items should be kept in the cache and allows you to remove items from the cache.

Do you need help selecting and implementing the best caching solution?

FAQ

Caching allows you to temporarily store elements of a page so that these data can be accessed faster. By storing temporary copies of a website, the computer no longer needs to regenerate the data.
  • Fast loading times
  • Stable website
  • Optimal user experience
  • Great for SEO (Search Engine Optimization)
When an Internet user wants to visit your website, a request is sent (via the Internet) to your server to display the content of the page. This request must be processed and imposes a certain load on RAM, disk space, CPU and network. This causes delays in returning the content.

Caching helps reduce this delay by temporarily storing the website files that are frequently requested in a different location. Since these data are stored separately, they no longer need to be requested from the server when the website is visited again. This ensures that the page is displayed much faster.

Rely on our caching experts

technologies_caching_img_2_alt

For years, Combell has been committed to achieving fast loading times and optimal user experience by means of caching solutions. Together with you, we look for the best solution for your website or application. Our experienced specialists are responsible for selecting and implementing the best caching solution.

technologies_caching_img_2_alt

Award-winning solutions

Smart Business Awards Hosting & Domain Names 2017
ISPGids
Twinkle Awards Hosting & Domain Names 2016
Webhosters.nl