Welcome! Log In Create A New Profile

Advanced

APC caching per location

Posted by lolallalol 
APC caching per location
July 01, 2013 10:26AM
Hi,

I'm trying to setup an APC opcode caching on a server.
On the server, I have aliases directory which may not be cached by APC.

It works when, in apc.ini, I put caching b_ default off and put each paths in the filters var. But I'm using multiple server on my Nginx and it's complicated to activate APC for each site I want.

APC seems to work globally for each host. For example, after a Nginx start, if the first request is on a location /to (ie. /to/file.php), APC will be enable for each location until the server restart. If I request /another.php, APC will not be enabled for the site. Beside, you'll see my site config :
-------------------------------------------------\
server {
listen 80;
server_name test3;
set $docRoot '/var/www/test/3';
root '/var/www/test/3';

if (!-f $request_filename) {
rewrite ^.*$ /index.php last;
break;
}

location ~ /to/.*\.php$ {
if ($fastcgi_script_name ~ /to(/.*\.php)$) {
set $valid_fastcgi_script_name $1;
}
include /etc/nginx/fastcgi_params;
fastcgi_param DOCUMENT_ROOT /var/www/test/to;
fastcgi_param PATH_TRANSLATED /var/www/test/to$valid_fastcgi_script_name;
fastcgi_pass unix:/var/run/phpfpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/test/$valid_fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "apc.enabled=1";
break;
}
location ~ /to(/.*) {
alias /var/www/test/to$1;
}

location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $docRoot/$fastcgi_script_name;
fastcgi_pass unix:/var/run/phpfpm.sock;
fastcgi_param PHP_ADMIN_VALUE "apc.enabled=0";
}
}
/-------------------------------------------------

So my question, is it possible to enable/disable APC by location or directory whithout modifying the apc.filters ?

I hope my question is understandable and may found a replier...
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready