we are using capistrano to deploy our PHP application. and php-apc is enabled on the production server with apc.stat = 0. In capistrano config there is a rule to clear apc cache after deploy:update :
after "deploy:update", "clear_apc_cache"
the cache is successfuly cleared: apc.php 'View Host Stats' shows an uptime of 0 minute, numbers of cached files & hits is close to 0 (not 0 because there is quite a lot of traffic and some files are cached before we can check apc.php)
the problem is, sometime an old file is still cached in apc. I think this is due to an HTTP request starting before capistrano update the 'current' symlink and ending after we clear apc cache. in that case, file included after apc clear in this request are still from the old revision folder (we are using relative path in include*s and require*s) and are saved in apc cache
Is there a way to permanently fix this? without updating all include*s and require*s?
for now I will try to delay the "clear_apc_cache" for one or two second but I'm afraid it will cause others problems during the delay (and some requests could still be longer than 2 seconds)