Search code examples
apc

How to use APC on a periodically updated system?


we have a system written in PHP stored on the production server. We have APC installed also.

Our system uses a special local repository on Mercurial and is periodically updated - some scripts are modified by developers, according to customer demands.

But as far as I understand, the APC cache will store the old versions of the files being modified? Does this mean, that the process of updating should look like this:

  • Pull the latest changes from repository.
  • Update the system.
  • Execute the script in order to force APC clear it's cache.

I ask this because I don't understand the mechanism that APC uses. Does it calculate a checksum in order to see, if the scripts have been updated? Or it cannot handle such a situation and I will have to clear cache manually?


Solution

  • APC will by default check file for changes and update automatically. No need to do anything manual. On very high traffic apps It is possible to set it not to check for file changes but the time it takes APC to do the test is negligible so its probably not what you need.