Hi :) >> However, I'm now investigating the ability to use memcache for the compiled >> templates and while I can see it would be easy to create a memcache resolver >> for loading templates it seems that the prepare() function is still >> hard-coded for file-based access. > > It is hardcoded, because with APC (or any opcode cache) this is the fastest > option – files are loaded in pre-compiled form from shared memory. To load > file from memcached AFAIK you'd have to eval() the source, and that cannot be > touched by opcode accelerators. > > If you don't want to touch spinning platters at all, then perhaps you could > use local, RAM-based filesystem for PHPTAL's template cache? Template cache > directory doesn't have to be shared between servers (the only caveat is that > you'll have to clean it up sometime: > http://phptal.org/manual/en/split/sysadmin.html)
Your points regarding opcode caches are some I'd not considered and I think a conversation with my sysadmin about what facilities are available and whether I can request something is in order :) My reason for considering memcache was simply that our filesystem is nfs to a san and the latency is huge. > I do have plan to change phptal:cache attribute to use different backends, > because that one doesn't benefit from being on disk at all. Because of the lack of a way to change the backend for phptal:cache, when I implemented the replacement zend view class I ended up just using zend caching and managing it within the view subclass rather than using phptal:cache. I needed a way to cache the result of a template render (because it would be accessed hundreds of times a minute but the data only changed every 5 mins) and phptal:cache didn't seem to offer what I wanted. The ability to write a plugin to support zend caching plus the ability to set the cache options programatically as well as in the template xml would be great (I don't believe caching instructions are always an attribute of the template). I've already made good use of the translator interface to write a Zend_Translate replacement to unify all my translation needs across Zend and PHPTal and it works extremely well. I've also 'patched' a way to do plural translations :) I very much hope all this code will be available soon so will let you know :) Robert _______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal