Smarty templates loaded during high traffic site result in blank page
I am running a very high traffic website that uses the Smarty templating system.
When I upload a new copy of the template that is currently in use, the page goes blank (as if there was nothing in the template file itself). I have to close lighttpd, load the template again and start lighttpd.
Are there any settings in Smarty that I should be using, perhaps I wasn't?
Here's a list of the variables I set inside Smarty itself:
$ smarty-> use_sub_dirs = true;
$ smarty-> compile_check = true;
a source to share
try to clear cached files? If the file is not fully downloaded and someone asks for it, it will be locked in the cache (at least that's what I think). I have used smarty and I am using lighttpd too. (decided to go XSLT)
if the page is requested more than 2 times per second, you can never actually update the file, unless your browser turns off. Or clear the cached smarty.
a source to share
You can enable caching before downloading the file (if already enabled, increase the timeout and make sure the entire template is cached). Enable cache and set it for a couple of minutes to prevent Smarty from collecting recently downloaded templates. Visit your template page to make sure Smarty cached it. Then download the template before the cache expires. Once the download is complete, you can turn off caching again (or revert it back to its original values).
You might want to add a configuration parameter to your application that can globally enable / disable this caching mechanism.
a source to share