Some experience in generating static pages _php Tutorials

Source: Internet
Author: User
Author: q3boy
Static page generation generally has so many ideas.
1. During the program writing process. Statements that do not use direct output. When all outputs are connected to the output string, the output is completed. Write the output string content directly to the file
2. Written in the normal way. The output is captured through the OB function group. Then write the output to the file
3. When using a template class, the output is obtained using a Get/fetch-type method. and write to the file.
There are two ways to achieve this.
1. When adding records in the admin background, the target HTML page is generated directly, and the foreground call connection points directly to the generated HTML page. The advantage of this method is that the program is most efficient. Server load is light, but because a purely static page is generated, all content pages must be regenerated once the page style has changed. So the actual use of the application is generally not too much. More is the use of client-side means such as js,ssi,xml/xsl, generated by the static file only save data, no style, so that can achieve speed and maintenance balance, but relative to the front and back of the program is more complex (when applying this method, because the content is pure static, Can be used with the purely static Apache that is compiled separately. More efficient and resource-intensive than dynamic content support
2. The front-desk access link points to the PHP program, and the PHP program first checks for the presence of the corresponding static file. If the static file does not exist. is generated and redirected to this file, otherwise directly redirected. This approach is actually used in conjunction with Apache's url_rewrite functionality. The PHP file address in the form of HTML, in favor of search engine retrieval. This method has a slight loss in efficiency, but the program structure is simple and easy to adjust, it is suitable for use when the traffic is not very large.

http://www.bkjia.com/PHPjc/532002.html www.bkjia.com true http://www.bkjia.com/PHPjc/532002.html techarticle Author: q3boy Static page generation generally has so many ideas. 1. During the program writing process. Statements that do not use direct output. And when all the output is connected to the output string, ...

  • 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.