开发者

Does smarty work fine when APC is installed?

开发者 https://www.devze.com 2023-01-17 21:51 出处:网络
I\'m developi开发者_如何学Pythonng my website using Php and Smarty. Now , i\'d like to caching the bytecode of the php script using APC, but i\'m worry that APC will cache also the complied smarty\'s

I'm developi开发者_如何学Pythonng my website using Php and Smarty. Now , i'd like to caching the bytecode of the php script using APC, but i'm worry that APC will cache also the complied smarty's templates, loosing the possible dynamic content. Is it possible?

Tanks


I have been using APC for over a year now and without problems on four different servers and more than 30 different sites. All these sites are Smarty ones, using dynamic content literally everywhere. At the moment I am using in a pretty heavily used customer site with no problems. Not once.

APC caches the compiled templates and re-caches them when/if they are altered (compiled by the Smarty compiler). The dynamic content will work exactly as previously, it will only be a bit quicker, of course.

So go ahead and use it.


I had problems with Smarty and APC together. An Apache restart was always required when something in the template had changed to prevent errors and confused templates.

I'm using an old version of Smarty and I found other problem descriptions and solutions on the net: http://erasel.net/2009-11-09/apc-und-probleme-cache.html

To prevent a APC and Smarty mixture use this settings in the php.ini

[APC]
apc.enabled          = 1
apc.cache_by_default = 1
apc.filters          = "AdoDB,adodb,ADODB,Smarty,smarty,.tpl"


Yes, it is. I used to do just that. Always test on your dev machine before deployment.

0

精彩评论

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