SmartVPS - the complete multi-account hosting solution! Each individual account comes with free backups, addon domains, PHP-FPM with OPcache and server-side caching for lightning-fast sites. And all this at a great price!
75% OFF ALL NEW PLANS + 100-DAY MONEY-BACK GUARANTEE
75% OFF ALL NEW PLANS

Server-side caching may help reduce page load times by a significant margin if configured properly. You can learn more about the server-side caching service available on our servers in the General information about server-side caching article.

To take advantage of server-side caching on a Drupal 8 website, you need to:

  1. Configure Drupal 8 to cache content
  2. Choose how to clear the cache
  3. Enable server-side caching

1. Configure Drupal 8 to cache content

By default, Drupal 8 allows you to specify for how long the cache should be stored via the max-age and Cache-Control headers. You can select your preferred caching period via the Caching menu from the Administration -> Configuration -> Development -> Performance section. We would recommend that you set the caching period to 1 year for best results.

2. Choose how to clear the cache

To have Drupal 8 clear the cache automatically when you make any changes to your website content, please follow these steps:

  1. Extend your Drupal 8 installation by adding the Purge and Generic HTTP Purger modules.

  2. Install the following components:

    Purge module - Purge, Purge Tokens, and Purge UI components
    Purge - Processors module - Late runtime processor component
    Purge - Queuers module - Core tags queuer component
    Purge - reverse proxies & CDNs module - Generic HTTP Purger and Generic HTTP Tags Header component

  3. Navigate to the Administration -> Configuration -> Development -> Performance section, and select the Purge tab that is now available.

  4. Click on the add purger button from the Cache Invalidation menu.

  5. Select the HTTP Purger radio button from the pop-up window that appeared.

  6. Click on the Add button.

  7. A new purger will appear above the add purger button. Open its menu by clicking on the downward pointing arrow on the button, select the Configure option, and a new window will pop up.

  8. Enter a name that describes the purger (e.g. Cache purger) in the Name field.

  9. In the Request tab, enter the following settings:

    Hostname: your_domain.com (Make sure you replace your_domain.com with the actual domain/subdomain where Drupal 8 is installed)
    Port: 80 (default value)
    Path: / (default value)
    Request Method: BAN (default value)
    Scheme: http (default value)

    Note: If your Drupal 8 installation is configured to always work over HTTPS, you should change the Port setting to 443 and the Scheme to https.

  10. In the Headers tab, enter the following settings:

    Header: Purge-Cache-Tags
    Value: [invalidation:expression]


Alternatively, you can purge the server-side cache for your domain/subdomain manually by using any of the methods provided in our Purging the server-side cache article.

Note: If you do not configure Drupal 8 to clear the cache automatically when content is changed, the Clear all caches button from the Administration -> Configuration -> Development -> Performance section will clear its local cache, but the server-side cache will not be cleared.

3. Enable server-side caching

Once you have prepared Drupal 8 for server-side caching, you can enable the server-side caching service by going to the hosting Control Panel's Server-side caching section and clicking on the Enable button next to the domain/subdomain where Drupal is installed.