Search code examples
phpapacheapc

Would APC work well for a highly dynamic PHP website?


This might be a trivial question for some, but I could not find the answer myself yet.

If I understand correctly APC does two things. Keep the PHP pages in byte code so they are delivered faster. It can also cache data so we can query them faster.

I'm interested in the byte code feature, which if I understand correctly comes by default. I will not need to modify my code much for this to work.

My question is this: Our website is a social network site and our PHP pages are highly dynamic. They are affected by many factors every time they are called.

Would we still benefit from using APC?

Thanks, Haluk


Solution

  • Yes that is exactly the type of situation that APC works great in (although it benefits all types of pages). It's essentially a "compiler" for PHP code.

    Unless the PHP code behind is changing more often than the page is loaded (I don't think that would EVER happen), APC will benefit you.

    For any static pages (or static parts of pages), you might want to look into caching the output to files on the system. That way, when you need to display that component, instead of running PHP code you can just serve up the cached HTML.