Home
/
WordPress Tutorials
/
Speed Optimizer Plugin Tutorial
/
Caching in Speed Optimizer

Caching in Speed Optimizer

Caching is one of the most effective speed-enhancing features for any website. At SiteGround we have developed a unique 3-layered caching system for all websites hosted with us – NGINX Direct Delivery, Dynamic Caching and Memcached. NGINX Direct Delivery handles static cache and provides the first base of caching and is active for all SiteGround-hosted sites. Dynamic Caching, along with Memcached provides a significant, up to 5x boost on top of the static cache and are the most effective caching mechanisms for WordPress sites. While Dynamic Caching is also enabled by default at SiteGround, the Speed Optimizer provides additional Dynamic Caching and Memcached settings that enables you to get the best out of both for your WordPress site.

Dynamic Caching

Important! The Dynamic Caching is exclusively available to SiteGround clients.

Dynamic Caching is a full-page caching mechanism powered by NGINX.

The full-page caching is enabled by default on a server level for all sites hosted at SiteGround. SiteGround will cache your WordPress, even if you don’t have the plugin installed. However, the Speed Optimizer gives you far more control over this process, and we strongly advise you to utilize it for the best dynamic caching results and complete access to the configuration possibilities.

Through the main switch, you can control whether your website is cached or not.

Non-SiteGround clients are unable to use the Dynamic Caching because the functionality relies on SiteGround’s specific server configurations to operate properly and is thus only available in the SiteGround environment. To achieve the best performance results, you can effortlessly transfer your website to SiteGround and take advantage of all of the unique speed enhancements that our environment provides.

File-based Caching

With file-based caching, every visit to your site will be faster. Our plugin will create a static HTML version of your website and store it in the WordPress cache directory.

To use the File-based caching feature, SiteGround clients must enable Dynamic Caching. The correlation between the features is carried out in order to deliver the optimal performance results. Both of them, when combined, provide you with ultra-fast speed thanks to our unique caching technology and improved SEO rankings thanks to file-based caching.

Non-SiteGround users are encouraged to migrate to SiteGround in order to take full advantage of the file-based caching, which gives faster performance when combined with our unique server-level Dynamic Caching.

The file-based caching is disabled by default and you can manage it by the main switch.

Configure File-Based Caching

Clean up interval

  • Off
  • 12 hours
  • 24 hours
  • 48 hours
  • 1 week – default option

Preheat Cache

When Preheating is enabled, our system will reload the cache once it is purged after content update in order to serve the fastest possible results to your real visitors. It is pre-selected by default.

Note that the preheat feature only works with the WordPress built-in cron functionality.

Logged-in Users Cache

By default, we do not cache content for logged in users. Once Logged In Cache is enabled, we will store separate caches for each user. Note, that if you have many users, the size of the stored cache may be increased.

Automatic Purge

Enabling this option will allow our plugin to flush parts of your cache once it detects changes in your content. We’ve developed a set of rules to purge the dynamic and/or file-based caching in a smart, efficient way depending on the change that has occurred on your site. We do a full cache flush on events like category deletion, plugin and theme update or switch, WordPress core update, etc. On the other hand, we do smart flush when a post is modified, a comment is added or a category is updated for example.

You can also choose to automatically flush the WordPress REST API cache too. This could be useful if you are using the API with external third party WordPress tools that depend on it to ensure there is no delay in the information they receive about your website.

We highly recommend this option to be ON, as it ensures that new content is timely shown on your site. However it is recommended to leave the REST API automatic cache purge option disabled unless you are actively using the REST API at the moment and you are experiencing problems with it.

Important! SiteGround clients would be able to enable automatic purge only if their Dynamic caching is active.

Important! Non SiteGround clients would be able to enable automatic purge only if their File-based caching is active.

Manual Cache Purge

You can use this option when you’re modifying new content and don’t have automatic purge enabled to make sure that you’re loading the latest version of your site.

Important! For SiteGround clients – If you have a WordPress multisite with a subdomain setup you must add the separate subdomains as parked in Site Tools > Domain > Parked Domains for the cache purging to work.

Exclude URLs from Caching

In certain cases, you may want to exclude parts of your website from the cache. We’ve developed an easy interface to do that. Click the pencil icon next to the Exclude URLs from Caching option and this will open a new window where you could simply paste the relative path to the URL you want to exclude or the entire URL – we will parse it and add it into the right format.

This function works for both dynamic and file-based caching.

In addition to exact URLs, you can use the wildcard sign “ * ” to exclude entire sections of your site. For example, if you want to exclude all posts in the “business” category, you can add:

https://yoursite.com/category/business/*

Or, if you want to exclude all URLs that have the word “business” in it, you can add:

*business*

Exclude Post Types

With this optimization, you can exclude all posts from the specific post type being cached by the Dynamic Caching. This will make sure all of them are served non-cached for all users.

How to Enable Browser-Specific Caching

We recommend you to enable this feature only if you’re experiencing issues with plugins, generating mobile version of your site or similar functionality. Once enabled, the cache has to be generated separately for different browsers which lowers its efficiency. To enable this feature move the Browser-Specific Caching toggle to ON.

Important! SiteGround clients would be able to enable browser-specific caching only if their Dynamic caching is active.

Important! Non-SiteGround users would be able to enable browser-specific caching only if their File-based caching is active.

Test Cache Status

Our caching system relies on headers and can be a bit tricky, especially for new users to tell if a certain result is served dynamically or from the cache. That’s why we’ve developed a quick cache testing tool to verify whether your URLs are properly cached. In addition to that, it’s a great way to test if URLs you’ve excluded from the cache are actually dynamic.

Memcached

Important! Memcached is exclusively available to SiteGround clients.

Memcached is one of the most popular object caching solutions. Once it is active for your account, you need to turn on the Memcached in the Speed Optimizer plugin too. This will configure your site to use the service.

Tutorial Menu

Share This Article