문제

I was having a scenario where on every request i had to fetch the data from database. SO i thought of using APC to cache the variable. But later found out that APC was no longer the choice for newer versions of PHP. So i checked out memcahced and APCu. Memcached is not the choice according to this. And i'm not sure for how long APCu will be supported by the developer community because i don't want to change my code once it it deployed.

Opcache is what replaced APC but it does not provide any way to cache variables. I'm confused. A little help would be appreciated.

Thanks in advance.

도움이 되었습니까?

해결책

Opcache caches the bytecode, and APCu is a simplified version APC, that only caches the userland part (and it's entirely compatible with the old APC, it just doesn't tdo the bytecaching any more). If you still want to cache locally, APCu is the way to go, and I'll be using it myself when it comes to such caching.

For larger, cross-machine caches, I'll also use Memcached.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top