PHP’s APC – Don’t back yourself into a corner

We heavily rely on running multiple instances of code where I work. At any given time several of us have several copies/branches of the site code configured to run from various spots on our development server.

A path we have gone down with APC’s user variable caching is merely one of convenience for the most part. There’s only one resource that comes to mind that requires caching.

At any rate, testing things in a multiple instance environment is prone to collisions. Much to my dismay, I find the APC configuration options lacking:

– Can’t set a global prefix – This could be wildly useful for shared hosts and for our scenario, set a global prefix and transparently prepend.

– Can’t turn entire thing off – You can’t turn APC off via .htaccess/ini_set() (forcing things to draw ‘fresh’ every time)

In a nutshell, start smart by generating a global prefix and being diligent with the prefix for your codebase. (Or, perhaps wrap APC to make this easier). It will pay off someday, I’m just glad we aren’t in too deep to quickly rewire it all.

No Comments

Start the ball rolling by posting a comment on this article!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">