开发者

Do I have to change my source code to use xcache or other PHP opcode cacher?

开发者 https://www.devze.com 2023-03-04 06:30 出处:网络
I would like to use a PHP opcode cache, like APC and XCache. TO have benefit from this cachers, do I 开发者_开发技巧have to change something on my php code or just install one of them?

I would like to use a PHP opcode cache, like APC and XCache.

TO have benefit from this cachers, do I 开发者_开发技巧have to change something on my php code or just install one of them?

I have seen there are APIs, do I have to use them?

Thank you


The APIs are to exert manual control over how the caches work, but if they are properly installed and configured, they will "just work".


About APC: you can just install APC and it will work.
If you want, you can adjust size of memory, allowed for APC.
And I recommend to set this setting:

apc.slam_defense = Off


As previous posters have mentioned, once properly installed, APC will "just work" by storing the compiled PHP code to save this having to be done each time. There is nothing else for you to do.

However, you can also leverage APC to store settings that you may have previously got from a database lookup for example. Take a look at apc_store and related functions.

0

精彩评论

暂无评论...
验证码 换一张
取 消