APC 中的 apc.filter

发布于 2024-09-26 12:14:21 字数 439 浏览 4 评论 0原文

我正在尝试在 APC 中使用 apc.filter 等功能。但是我所做的一切都不起作用。

我应该完成 2 项任务。

1)需要包含 1 个用于缓存的目录。我在 apc.ini 中的代码

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/.*"

有人可以帮我吗?plz

I'm trying to use such function as apc.filter in APC.But all, that i have done, didnt work

There are 2 task that I should done.

1)Need to include 1 catalog for caching.My code in apc.ini

apc.cache by default Off
apc.filter = "+/path1/.*"

Such option doesnt work.It's still caching

2)Need to exlude 3 catalogs on the server that shouldnt be cached,for example my code in apc.ini for such task

apc.cache by default On 

apc.filter = "-/path1/path2/.*,
apc.filter = "-/path3/path4/.*,
apc.filter = "-/path5/path6/.*"

Can somebody help me with it?plz

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

玻璃人 2024-10-03 12:14:21

apc.filter 不适用于绝对路径
http://www.php.net/manual/en /apc.configuration.php#ini.apc.filters

您可以尝试使用 .htaccess 指令为特定文件夹启用/禁用 apc。

就我而言,我需要禁用整个站点的 APC 缓存,因此我将以下内容放入 root .htaccess 中:

php_flag apc.cache_by_default Off

它工作得很好。

apc.filter does not work for absolute path
http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters

You can try to enable/disable apc for particular folder by using .htaccess directives.

In my case I need to disable APC cache for whole site, so I put the following into root .htaccess:

php_flag apc.cache_by_default Off

And it works perfect.

野味少女 2024-10-03 12:14:21

我认为您犯了一个拼写错误:它是 apc.filters 而不是 apc.filter

对于您想要实现的目标的示例:

apc.filters = /path1/path2/.*,/path3/path4/.*,/path5/path6/.*

应该做到这一点,并将默认缓存设置为“开”。

I think you've made a typo: it's apc.filters not apc.filter

For an example of what you're trying to achieve:

apc.filters = /path1/path2/.*,/path3/path4/.*,/path5/path6/.*

should do the trick, with a default cache set to On.

毅然前行 2024-10-03 12:14:21

我想为我的开发环境做同样的事情。由于生产和开发代码都位于同一服务器上,因此我想要一种不缓存“测试”目录的方法。
我尝试使用

apc.filters -/my loc/my_test/.*,-/full_path/my_test/.*

但这不起作用。最简单的修复方法是修改您想要阻止缓存的目录中的 .htaccess

<IfModule mod_php5.c>php_flag apc.cache_by_default Off</IfModule>

并且它工作得很好。:)

I wanted to do the same thing for my development environment. Since both production and development code were there on the same server, I wanted a way not to cache "test" directory.
I tried using

apc.filters -/my loc/my_test/.*,-/full_path/my_test/.*

But this does not work. The simplest fix is to modify .htaccess in your directory that you want to block being cached

<IfModule mod_php5.c>php_flag apc.cache_by_default Off</IfModule>

And it works beautifully.:)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文