Caching is an important aspect of content delivery to reduce the page loading time. SiteGround offers three levels of caching – Static, Dynamic and Memcached, for all WordPress plans. Though this is cool to speed up your site, sometimes you need to disable the caching to avoid conflicts. Here are some of the reasons why you should stop the caching and how to disable caching in SiteGround hosted WordPress sites.
WordPress Caching in SiteGround
Here are the three cache types you can use in SiteGround:
- Static (Nginx) – for files like CSS, JS and image.
- Dynamic (Nginx) – full page level caching
- Memcached – object caching
By default, all WordPress installations in SiteGround comes with SG Optimizer plugin. In addition, you have the caching setup in Site Tools hosting panel. This can easily confuse you to have options in two places.
Disable SG Optimizer Caching
- Login to your admin panel and navigate to “SG Optimizer > Caching” section.
- Simply turn off the options for Dynamic Caching, File-Based Caching and Memcached.
- Click the “Purge SG Cache” option showing on top bar to delete the previous cached files.
Remember, the plugin has other useful functions like forcing HTTPS, compressing images, converting images to WebP format, minify, combine, preloading, etc. So, when you have another plugin installed for caching, make sure to disable SG Optimizer caching options and other overlapping features.
Disable Caching in SiteGround Hosting Panel
Disabling caching in SG Optimizer or even uninstalling the plugin will NOT completely disable the caching setup in SiteGround. You should also disable static content delivery from Site Tools hosting panel.
- Login to your SiteGround hosting account.
- Go to “Websites” tab and click “Site Tools” button showing below the website that you want to change the settings.
- Navigate to “Speed > Caching” section.
- Under “NGINX Direct Delivery” tab, turn off the buttons against your primary and subdomains.
- Go to “Dynamic Cache” tab and click “Flush Cache” icon against primary and subdomains to clear the cache. As you can see, there are no options to disable dynamic cache in Site Tools. By default, dynamic cache is enabled on all SiteGround servers and you can’t disable whether you use SG Optimizer plugin or not.
- Finally, go to “Memcached” tab to flush the cache and turn it off for “All Sites”. This will disable object caching even if you have enabled the option in SG Optimizer settings.
Why to Disable Caching in SiteGround?
Now that you may ask why to disable static and other caching setup in SiteGround. There are many reasons and here are some of the caches.
Using Another Caching
SG Optimizer does not offer many optimization features like delay JS, remove unused CSS, etc. You need another caching plugin if you want to pass Core Web Vitals or get good speed score in Google PageSpeed Insights tool. Most caching plugins add drop-in plugin like “advanced-cache.php” which you can see under “Plugins > Installed Plugins > Drop-in” section. This will conflict when you have two plugins trying to do the same work. Plugins like WP Rocket will automatically disable SG Optimizer caching setup. You can test any of your site’s URL by going to “SG Optimizer > Caching > Test URL Caching Status”. The status will show an error message saying, “The URL is not cached”.
So, if you have problems with multiple caching plugins, disable the SG Optimizer caching as explained above.
Using Third-Party CDN Like Cloudflare
Cloudflare and many other CDN setup needs you to use custom nameservers and redirect all traffic through them. In this case, probably all your static files are served from CDN and you do not need SiteGround NGINX caching.
NGINX Direct Delivery Will Not Work with Custom .htaccess
This NGINX static caching will work only with the default .htaccess file. If you want to add any custom directives in your htaccess file, then you should first disable NGINX static cache in Site Tools. Otherwise, the function will not work as you expect. You can see the instructions mentioned in the box on the SiteGround “Caching” section as below:
“For best results we highly recommend having NGINX Direct Delivery enabled at all times. However, if you need to use custom caching .htaccess rules for your static content, you may need to switch it off”.
There are many reasons you may want to add custom directives in .htaccess file and here are few examples:
- Add cross origin header in htaccess – you may need this for the third-party advertisements to work properly. Companies like AdThrive will ask you to do this so that the ad requests are not blocked.
- Prevent image hotlinking – plugins like All In One WP Security and Firewall offers image hotlinking prevention feature. This will add entries in htaccess and works only when you disable NGINX static cache on SiteGround server.
Final Words
SiteGround comes with plenty of default features like caching and security. However, in most situations you need to go with another solution that fits your need. When some caching related stuff is not working in your WordPress site, follow the above steps and disable caching from SiteGround to fix the problem. Similarly, you need to disable Nginx static cache when custom .htaccess directives are not working.
Leave a Reply
Your email is safe with us.