Questions about Smarty template efficiency

Source: Internet
Author: User
Smarty template efficiency issues! Recently I used the Smarty template and found that file_exists is often used. does this increase the I/O burden? is this inevitable ?, It will not affect the efficiency of the includ Smarty template. the server is much more robust than you think because it needs to translate your template file into a php program!
Recently I used the Smarty template and found that file_exists is often used. does this increase the I/O burden? is it inevitable?

------ Solution --------------------
The server is much stronger than you think.
Because he needs to translate your template file into a php program, include it when using it
So of course, you need to check whether the file exists. In addition, he also needs to check whether your template file has been changed. if so, he will re-translate it into a php program.
If you enable caching, you also need to check whether the cached file exists and whether it is too old. In this way, Jiuding directly uses the cached file or re-generates the cached file.
------ Solution --------------------
Network-related IO, such as echo without buffering

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.