开发者

Caching functions instead of require_once in php

I've been using APC caching functions and it's been phenomenal. I was thinking, why not just cache all of my functions, and load them whenever I n开发者_如何学JAVAeed to (kind of like frameworks actually).

function Foo {echo 'bar';}
$foo = Foo;
apc_store('foo',$foo);

And then whenever Foo is needed, I'd just use apc_fetch. Is that more efficient/quick than require_once? Is it a smart move to do? (especially when you have a lot of function files)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜