我正在尝试在APC.But all中使用像apc.filter这样的函数,我已经做过了,但没有工作
这里有两个我需要完成的任务。
1)需要在apc.ini中包含1个caching.My代码目录
apc.cache by default Off
apc.filter = "+/path1/.*"这样的选项不起作用,仍在缓存中
2)需要在服务器上列出3个不应该被缓存的目录,例如我在apc.ini中为这样的任务编写的代码
apc.cache by default On
apc.filter = "-/path1/path2/.*,
apc.filter = "-/path3/path4/.*,
apc.filter = "-/path5/path6/.*"有没有人能帮我一下?
发布于 2010-11-26 06:29:44
apc.filter不适用于绝对路径http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters
您可以尝试使用.htaccess指令为特定文件夹启用/禁用apc。
在我的例子中,我需要禁用整个站点的APC缓存,所以我将以下内容放入根.htaccess:
php_flag apc.cache_by_default关闭
而且它工作得很完美。
发布于 2011-12-06 21:21:07
我想你打错了:是apc.filters而不是apc.filter
举一个你想要实现的目标的例子:
apc.filters = /path1/path2/.*,/path3/path4/.*,/path5/path6/.*在默认缓存设置为On的情况下,应该可以完成此任务。
发布于 2014-05-20 14:35:00
我想为我的开发环境做同样的事情。因为生产和开发代码都在同一台服务器上,所以我想要一种不缓存"test“目录的方法。我试着用
apc.filters -/my loc/my_test/.*,-/full_path/my_test/.*但这是行不通的。最简单的修复方法是修改目录中要阻止其被缓存的.htaccess
<IfModule mod_php5.c>php_flag apc.cache_by_default Off</IfModule>它工作得很漂亮。:)
https://stackoverflow.com/questions/3873772
复制相似问题