Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to exclude .php file from APC cache?

Tags:

php

caching

apc

I cache top users data in a file named top_users.php, let us call it file cache.

But the APC will cache all the .php files, how to exclude some special .php file from APC

cache?

like image 397
koogua Avatar asked Feb 19 '23 11:02

koogua


1 Answers

You can use filters in your apc config file:

apc.filters = "-/usr/share/files/.*"

This would not cache files under that match that pattern basically any file under that path /usr/share/files/

For you, you could use:

apc.filters = "-/my/share/top_users\.php"

Check this out http://www.php.net/manual/en/apc.configuration.php#ini.apc.filters

This assumes the file is being required or included by absolute path.

like image 152
Ray Avatar answered Feb 20 '23 23:02

Ray