What is a domain?

/What is a domain?

WordPress caching settings

When you set the PHP and caching settings in your cPanel and WordPress website correctly, you will experience a better performance. Your website is not only much faster, but it also process much more traffic simultaneously. This functionality is included, free of charge, and you can set it up yourselfby following the steps below. Below, you will find a step by step explanation of what caching is and how to apply it for WordPress sites hosted on Hoasted in an optimal manner.

What is Caching?

A cache is a part of the server memory. Recently saved and / or frequently used information are stored here. When a web page is requested, all components are invoked from the website (database, PHP scripts, images, CSS files, etc.), and a result of all scripts will be shown. Through that process, which has a short duration (average between 200 ms and 3 seconds), all PHP scripts are invoked and calculations re-performed.

When a site is cached, this means that only the result (the cache) of the scripts is displayed (your site will be served from the cache). This is a very efficient way to make your website very fast. For example, if you receive 10 website visitors at any given time, the website is loaded normally to the first visitor and then immediately put into the cache. For the next 9 visitors the website will be loaded from cache, making the loading time much shorter.

The cache of your website or webshop is automatically recreated when a user makes a change in the web site.

Step 1: cPanel settings

  1. Login to the cPanel
  2. Go to ‘Select PHP version’ under Software > SELECT PHP VERSION
  3. Tick the OPCACHE + APCU boxes
  4. Click on save

WordPress caching settings

Step 2: WordPress settings

  1. Login to the WordPress installation
  2. Instal the plugin ‘W3 Total Cache’ (W3 Total Cache) on your website and activate
  3. Go to the plugin settings (You can do this in your WordPress admin under menu item ‘Performance’ > ‘General Settings’) and set the following items:
    • General: Toggle all, don’t set this (leave deactivated)
    • Page caching: activate this and set to ‘disk enhanced’
    • Minify: don’t set this (leave deactivated)
    • Database Cache: don’t set this(leave deactivated)
    • Object cache: don’t set this (leave deactivated)
    • Browser Cache: activate this (activate)
    • CDN: don’t set this (leave deactivated)
    • Reverse proxy: don’t set this (leave deactivated)
    • Monitoring: don’t set this (leave deactivated)

If you also use an SSL certificate on your domain we suggest to activate the option ‘Cache SSL (https) requests’   ‘Page Caching’.

Step 3: deactivate other caching plugins

In case you previously used other caching plugins, it is important that they be deactivated in your WordPress backend. Below is an overview of the most common WordPress caching plugins:

  • ​WProcket
  • WP Super Cache
  • WP Fastest Cache
  • Zen Cache
  • Cache Enabler

Step 4: Exceptions (i.a. for Woocommerce users)

In case you’re using Woocommerce or dynamically generated pages, it is imperative that you process the URL’s of your website / shop in the caching plugin. You can do this with the following steps:

Mfunc (Woocommerce)

  • Under ‘Performance’ > ‘Minify’, you can add ‘mfunc’ to the list ‘Ignored comment stems’ like in this example.

Woocommerce caching settings

Caching exceptions for shop and account pages (Woocommerce)

  • Under ‘Page caching’ > ‘Never cache the Following pages’ you can add the following caching exceptions. You do not want to pages related to user accounts, shopping carts and checkout are cached, as these pages include dynamic content. By adding these exceptions to the W3 Total Cache plugin these pages will never be cached.

If your shop pages have other names, then you need to add then (ie above URLs + your own WooCommerce URLs). Such is the case if you installed WooCommerce in a languageother than English. If you’re not sure what the exact links to your WooCommerce shop page are, you can find them in your system. View them in your system status using the following steps:

  1. Open your WordPress dashboard
  2. Go to Woocommerce > System Status
  3. A page with a list of all your WooCommerce settings opens. Under the heading ‘WC Pages’ you can see under what URL your dynamic WooCommerce shopping pages are. You can see this the examples below, the names (Winkelbasis) of the pages, the page ID (# 8) and the url slug (/ store /). What you need is the URL slug (in this case /winkel), which you can add to the aforementioned caching exceptions.

Woocommerce settings

Below you can see what a Swedish Woocommerce webshop can look like.

Woocommerce web shop settings

Caching exceptions for other pages (for other dynamic pages)

  • In case you have other pages that are dynamic and may not be cached, you also add them to the list.

If you have any questions or need assistance with your caching setting, feel free to send an email to support@hoasted.com, and one of our colleagues will gladly help!

2018-07-18T13:47:54+00:00 juli 18th, 2018|Developers|Reacties uitgeschakeld voor WordPress caching settings
Hoasted support

How can we help you?

We want you to ask us questions, because we love to help you in accomplishing your goals. We let no questions unanswered, provide you with high speed responses and leave no problem unsolved. What is important to you, is important to us. Shoot us a message and see for yourself.