I was surfing on the net to see how to boost my php applications speed when I found out about APC. The informations I found are quite confusing because in some case it says that it will pre-compile the php code an开发者_如何学编程d cache. And some other website show some code to cache variables.
My first question is : Does APC pre-compile the code or you use it to cache data like memcache?
My second question is : If APC really do pre-compile the code, is it better to use it with memcache or not?
PS : if you have more informations on how to boost php applications, I will be please to receive your advice.
You can and should use both.
APC will compile your PHP into opcodes and cache these opcodes on the webserver. So each subsequent time a php script is called it isn't parsed and compiled. Turning on APC can give you significant speed improvements.
Memcache acts as a in-memory hashtable for application data (not opcode cache) that lasts between PHP script calls. It's strength is that it can be easily distributed. Most people use it to take off load from their database.
精彩评论