开发者

Can I nest APC ( Alternative PHP Cache ) inside itself?

开发者 https://www.devze.com 2023-03-28 11:50 出处:网络
Just a quick simple question that I can not seem to find an answer for. Can I nest APC cache inside another one?

Just a quick simple question that I can not seem to find an answer for.

Can I nest APC cache inside another one?

For example, say I cache a page and I wanted it updated hourly, but I have a sidebar inside that page that I want updated every 24 hours.

Thanks!

edit: I am not asking how to do this, just if it is possible.开发者_开发技巧 Examples not required, unless it is a unique technique then how to normally use APC.


Short answer: NO.

Long answer: you might be able to do that, but you'd have to break the page into multiple sections, and cache each section independently, and when recomposing the final page to be sent to he user grab each section from its cache...


Yes, it's possible. Save the segments into separate APC variables via apc_store() and set their TTL (time to live) to 60*60 or 24*60*60, respectively.

0

精彩评论

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