Front-end development-when PHP combines static pages on the server side, does the combination of multiple HTML affect efficiency?

Source: Internet
Author: User

Recent data found that the front-end page modularity advantages are many, so want to our front-end work from the work of the page assignment to the modular allocation of work, while improving the internal front-end development specifications.

不知道这样会对页面的服务器请求造成压力吗?

For example: Now the backend is the combination of head.html, content.html, footer.html. However, some pages have the same modules, which are time-consuming and error-prone when changing requirements. So want to make the page into head.html, nav.html, slider.html, module-1.html, module2.html ..., footer.html this combination way. And then the CSS with sass split.

In the front-end is still a small white, if you ask the wrong place please correct me.

PS: There is no front-end leader in the company, self-study good hard.

Reply content:

Recent data found that the front-end page modularity advantages are many, so want to our front-end work from the work of the page assignment to the modular allocation of work, while improving the internal front-end development specifications.

不知道这样会对页面的服务器请求造成压力吗?

For example: Now the backend is the combination of head.html, content.html, footer.html. However, some pages have the same modules, which are time-consuming and error-prone when changing requirements. So want to make the page into head.html, nav.html, slider.html, module-1.html, module2.html ..., footer.html this combination way. And then the CSS with sass split.

In the front-end is still a small white, if you ask the wrong place please correct me.

PS: There is no front-end leader in the company, self-study good hard.

Splitting into too many files is definitely a matter of efficiency, but at least it will be negligible at the beginning. static files (CSS,JS) are generally eventually merged into a single file, and they also compress whitespace and line breaks. Because many of the existing versions of browsers are blocked when loading static resource files, it is necessary to open an HTTP connection, download a file, close an HTTP connection, and more than one file. Even a lot of small icons are synthesized into a picture to reduce the number of HTTP requests. At the end of the day, you can also consider the static, through the backend to merge these modules into a static page to save and output, the second time access, the direct read cache can be.

The modular allocation is indeed better than the page allocation.
Too many points can affect efficiency, but this distinction is largely negligible.

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