使用APC缓存的多个Symfony2站点 [英] Multiple Symfony2 Sites using APC Cache

查看:40
本文介绍了使用APC缓存的多个Symfony2站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个使用Symfony2框架的站点,它们的文件相似.

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

这些站点都在同一台服务器上,并使用APC缓存.

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.

任何使用过的APC都有不同且唯一的密钥.

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

是否有某种方法可以为每个站点拆分APC缓存或设置前缀或其他内容?

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

推荐答案

您是否尝试过使用

Have you tried to use ApcUniversalClassLoader()?

根据手册,在您的autoload.php中,您可以使用不同的键引导APC:

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');

干杯;)

这篇关于使用APC缓存的多个Symfony2站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆