Open gunnicom opened 1 month ago
This pull request has been mentioned on SuiteCRM. There might be relevant details there:
https://community.suitecrm.com/t/apc-cache-not-working/69261/2
Hi Gunnicom,
Thanks for contributing to SuiteCRM.
I have tested your changes and they work well.
Having looked at the code, there are some related changes that may be worthwhile.
apc_clear_cache
is used in include/SugarCache/SugarCache.php
around lines 119apc_delete_file
is used in include/SugarCache/SugarCache.php
around lines 157The check && ini_get('apc.stat') == 0
may no longer be required on the above also?
In addition it may be worth lowering the priority in include/SugarCache/SugarCacheAPC.php
line 49
Changing protected $_priority = 940;
to protected $_priority = 890;
will ensure APCu is prioritised over other caches that may be available but not fully configured such as memcached.
@simonr44 At first I thought about the file include/SugarCache/SugarCache.php, too, but on second look I assumed, that that is only for OPcache part of APC, that vanished long ago. So I decided to not include that here. The real solution would be to remove that part completely.
Agreed yes APCu no longer includes opcode caches, however clearing the APCu cache when this function is called may still have benefits. Perhaps the function name is no longer too relevant but it may still have value in one form or another.
On further inspection apc_delete_file
looks obsolete now, so 157 - 159 could go?
apcu_clear_cache()
may still be worth calling in cleanOpcodes()
@simonr44 That could all be discussed in a different issue/PR. Keep this PR to fixing APCu functionality, and leave cleanup of old obsolete APC OPcache to a different PR.
There is a good chance we would look to bring these changes in together and test together so we'll make a new PR to cover those.
Thanks again for your contribution.
See https://github.com/salesagility/SuiteCRM/issues/10427