Multiple Symfony2 Sites using APC Cache

我的未来我决定 提交于 2020-01-02 10:08:49

问题


I have two sites using the Symfony2 framework that have similar files.

The sites are both on the same server and use APC cache.

I have noticed that some items that are on one site are then used on another site.

Any APC that has been used have different and unique keys.

Is there some way of splitting the APC cache for each site or set a prefix or something?


回答1:


Have you tried to use ApcUniversalClassLoader()?

According to manual, in your autoload.php you can boot APC with different keys:

require __DIR__.'/../vendor/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';

$loader = new ApcUniversalClassLoader('your_application_key');

Cheers ;)



来源:https://stackoverflow.com/questions/11395298/multiple-symfony2-sites-using-apc-cache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!