On 02-03-2010 at 11:09:36 Robert Goldsmith <rgoldsm...@names.co.uk> wrote:

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.

Compiled templates are saved in /tmp/, which shouldn't be NFS.

PHPTAL does check if source template file has changed, and this may involve NFS. If you'd like to avoid that, then this is possible within existing API:

implement PHPTAL_SourceResolver and PHPTAL_Source that find and load template source the way you want (e.g. cache template modification date in memcached) and make PHPTAL use it with PHPTAL->addSourceResolver().

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 :)

That would be very useful indeed! Thanks in advance.

regards, Kornel

PHPTAL mailing list

Reply via email to