How to disable XCache on websites
XCache is a PHP function or module for websites that is useful for speeding up website loading. Basically, XCache is a type of PHP accelerator, but its usage is almost the same as the cache plugin that can usually be found in WordPress.
By installing XCache, you no longer need to use a cache manager plug-in, as this function already works well. However, some people may have problems with this XCache, especially for web developers.
XCache is not attached to the browser cache, but directly from the server. Regardless of whether you clear the cache in the browser, that is will still stick when you visit the site. Of course, if it’s not temporarily disabled it will be a problem for web developers on construction sites.
How to disable XCache
There are several ways to disable this XCache feature, but here I am going to introduce the two easiest ways to do it without deleting them.
1. Via cPanel
If the website you manage uses cPanel, the server service sometimes offers the option to enable or disable the PHP module as needed. It can be found in the menu on the cPanel page Select PHP version.
And in the PHP module that appears, please uncheck the box on Xcache to disable it. Then save the settings and of course Xcache has now been switched off successfully.
2. Via PHP.ini settings or Htaccess
You can also disable Xcache directly from the file settings php.ini. If the server service allows its users, overwrite PHP settings, then you can create a php.ini file in the root or main directory of the website. Then enter the following code to disable Xcache.
xcache.cacher offxcache.size 0xcache.stat off
Alternatively, you can also set it from a file .htaccess and the code is almost the same, please copy it below.
php_flag xcache.cacher offphp_flag xcache.size 0php_flag xcache.stat off
After you have made these settings, Xcache will certainly no longer work on the site. You can feel it as the website loads, which feels longer than before, even though it has been updated many times.
This is different with Xcache, the website initially takes a little longer to load, then it goes quickly because the page is set to at this point static HTML, so PHP won’t be processing any data anytime soon.
Also Read: How To Clear DNS Cache On All Devices
Know the Xcache status on the page
Perhaps you are still curious as to whether this Xcache has been successfully disabled or not. Although above I explained the easiest way to find out if the module works or not after disabling it, but if you want a more specific way then it is better to look directly Request header on the website.
You can see Request header scroll through the functions Check element on the browser. Or you can also use the service on the HTTP header checking page.
If XCache has been deactivated successfully, no request headers may be named X cache that reappears. But if it’s still there, then Xcache isn’t actually disabled.
The server service sometimes restricts which features the user can disable, but as long as you don’t have access to the PHP settings on the server system, only the above method can be used.
However, some server services also allow users to disable or enable a PHP module for their needs. The user just needs to contact the server support service to ask for permission.
Hopefully useful and good luck