Re: [SMARTY-DEV] smarty recompiling with op-code accelerators
[email protected] ("Mark Rogers")
| Newsgroups | php.smarty.dev |
|---|---|
| Organization | Quarella Ltd |
| Message-ID | <01a301c464f9$cb14f880$b4cefea9@mark> |
Monte writes: > That may help with Smarty upgrades, but does not address the original > issue presented in this post. The accelerator op-code cache still won't > refresh when the templates_c directory gets cleared (outside of a Smarty > upgrade.) The original issue was about deleting the cache "when upgrading Smarty or making other major changes", so this would solve the problem in the first case but not the second. In my recent experience the need to delete the cache for anything other than a Smarty upgrade has been rare (I can't remember a time when doing so other than when trying to determine the cause of odd behaviour, under which circumstances I'd restart (or even disable) the op-code cache anyway. In all cases where I've done this, emptying templates_c hasn't fixed the problem anyway. Smarty is just too damn reliable! Therefore in my limited experience, including the version in the hash would solve this problem well over half the time. (Thanks for mentioning it, btw: it hadn't crossed my mind before.) What do opcode accellerators normally check for? Just mtime? Does the inode not come into the equation? (Of-course things are different with Windows which also needs to be supported by any solution.) IMHO we shouldn't really be telling the OS that the file hasn't changed when it has, which appears to be what we're doing here - presumably that also has implications for backups (if anyone is backing up templates_c, which I'm sure some people are), and doubtless other situations which (like the op-code cache) aren't obvious until they bite. Should we instead be looking for a better way for Smarty to determine that the file matches the template and doesn't need recompiling? -- Mark Rogers, More Solutions Ltd :: Tel: 0845 45 89 555