Add the apcu caching ability for performance (#7276)

* add the apcu caching ability for performance
When the PHP extension APCu is loaded, the settings class and the auto_loader will cache their results across requests in RAM. For more information about the APCu extension visit the PHP page: https://www.php.net/apcu

* use global instead of default terminology
This commit is contained in:
frytimo
2025-02-25 20:21:41 -04:00
committed by GitHub
parent 305f585b17
commit d919a3cc1b
7 changed files with 171 additions and 37 deletions

View File

@@ -187,6 +187,17 @@ class cache {
closelog();
}
//check for apcu extension
if (function_exists('apcu_enabled') && apcu_enabled()) {
//flush everything
apcu_clear_cache();
}
//remove the autoloader file cache
if (file_exists(sys_get_temp_dir() . '/' . auto_loader::FILE)) {
@unlink(sys_get_temp_dir() . '/' . auto_loader::FILE);
}
//cache method memcache
if ($this->method === "memcache") {
// connect to event socket