The difference between shtml and html

  • Shtml is also a web page file, with two extensions: shtml and shtm. But it is a static web page dynamically generated by the server, which requires the server to have its own SSI to process the static web page, which is usually called a "pseudo-static" web page.

  • The formats of shtml and html are similar. Shtml can mainly use include, which can embed other pages into this page and display them dynamically, and then generate static pages through the server, but static html pages cannot.

  • Not all IIS servers can parse shtml files. To parse shtml files, you need to enable SSI in the IIS server.

Give a chestnut:

A is a static web page of shtml, and A includes B static html page. When the browser opens A, it will display the original content of A and the content of page B. If you check the source code of the web page, you will not find traces of the introduction of B, but you will see that the content of B is completely in A. inside.

How to use shtml

<!--#include file="Web page file address"-->

From the perspective of website optimization, static web pages are more conducive to search engine optimization than dynamic web pages. Although SHTML is also a static page, SHTML is a static page generated by the server. When opening such a pseudo-static page, you also need to load files, load the server, accelerate data, etc. Therefore, in terms of loading speed, SHTML is not as advantageous as pure static pages. Of course, if the server is in good condition in all aspects, with high configuration and large bandwidth, then the impact may be similar.

Although SHTML is not as good as HTML in terms of website optimization, it also has certain advantages compared to other pseudo-static pages or dynamic pages. SHTML is more popular with large portal websites. This is because this type of website needs to update and publish a large number of articles every day. If you choose pure static files, then the update will be very time-consuming and the management will be inconvenient. The advantage of dynamic files is that they do not need to be updated, but they are difficult to optimize. However, SHTML files are different. Using the inclusion of SHTML, you can modify it in the included file, and all pages will be modified accordingly. There is no need to regenerate static files, so it is better than dynamic files. The effect of file optimization is much better.

As for which one is better, SHTML or HTML, it depends on the specific website type. For personal blog websites or corporate websites, it is better to use HTML files directly, because compared to portal-type websites, these types of websites have fewer daily updates, and they mainly use internal pages to participate in rankings, so use HTML is more advantageous. For large portals or information websites, if you want to use content pages for ranking, it is better to choose SHTML.

Guess you like

Origin blog.csdn.net/qiuhaifeng_csu/article/details/128846049