Quote:
Originally Posted by Andreas
Nice idea though I see two problems:
1) You could run into an endless loop trying to get a lock
2) Increased memory footprint
After some time, you've effectively cached templates for all actions.
I played with template caching myself (using APC) some time ago and didn't get any performacne increases - it even seemd to be a bit slower.
What are your experiences?
|
Using MySQL to get a first lock, then using FLOCK to attempt a lock there is a very minimal chance of running into an endless loop; even so it would timeout eventually as there is no code to not prevent from timing out. Even so, I could add a small counter into the while loop.
The memory footprint is increased with subsequent caching, and i Discussed that with a couple of other people while deciding how i should delegate uncached templates; at first I was sorting caches by their GET request ie.
private_trackpm_1.php and so forth; the problem with this is that there is no way to tell if the do= is a valid request, and would subsequently create bogus template cache files that were based off of global headers inherent to each inclusion of ./global.php
If you have a better idea feel free to say.
ps. It is faster on my end using this system; with a better plan and support for SHM via eaccelerator/apc/ etc.. it can be increased.