Reset ACP Opcode Cache on Deploy

Normally when deploying a php webapp, apc will automatically reset cache for changed files. However in our case we have our code hidden behind some nested symlinks. Most times when we deploy our webapplication it is while it is being used. And since much of the work our application does is related to moving large files, it is never good to restart apache when we deploy, since most file transfers will halt.

In stead we have created a simple controller method with some authentication, which calls a apc api method called apc_clear_cache('opcode'); - this will clear the opcode cache.

You have to call it for the web-context - and for cli context, if you have apc.enable_cli=1. Therefore you need a controller action with this code - and call it through curl. Please also remember that the url should require some sort of authentication, otherwise anybody (knowing - or being able to guess - the url) could reset your cache.