As we all know, the web pages, websites or web pages we browse every day have their own suffixes, and different suffixes correspond to different file formats and different regulations, protocols, and usages. The most common suffixes are .html and .htm, as well as the common .shtml and .shtm formats. Most of us developers only know that they are not much different and can be used at will, but we don’t know that there are still some connections between them. The author has briefly summarized them and would like to share them with you. First, let's introduce .html and .html HTML is the most basic and widely used storage format for web page files today. It is a hypertext markup language and the description language of the WWW. It is different from the text formats saved by dynamic web page technologies such as PHP, jsp, and asp. There are no statements to be executed on the server side embedded in the page. It is a static page format that can be directly interpreted and displayed by general browsers. Regarding htm, there is actually no essential difference between it and html. It is just to meet the DOS file name standard of 8+3 (the file name cannot exceed 8 characters, and the extension cannot exceed 3 characters). Because some older systems (32-bit) cannot recognize 4-digit file extensions, some servers require that the last l in .html be omitted. The browser can automatically recognize and open these files, but the URLs of these web pages must correspond when they are written, that is, index.html and index.htm are two different files corresponding to different addresses. Next, let's introduce .shtml and .shtm Regarding shtml, it is a file based on SSI technology support, that is, Server Side Include--SSI server segment inclusion instruction. If some Web Servers have SSI function, they will give special treatment to shtml files. The server will first scan the shtml file to see if there are any special SSI instructions. If so, it will interpret the SSI instructions according to the setting rules of the Web Server, and then after the interpretation, it will be interpreted and displayed by the browser like ordinary HTML. Regarding shtm, the relationship between shtm and shtml is roughly similar to the relationship between htm and html, so I won't go into details here... Finally, the relationship between html or htm and shtml or shtm HTML or htm is a static page format, which means that the server does not need to parse the scripts in it, or there are no server-side executed scripts. However, shtml or shtm is based on SSI technology. When there are server-side executed scripts, it is regarded as a dynamic language, just like PHP, JSP or ASP. When shtml or shtm does not contain server-side executable scripts, its function is the same as html or htm. The difference between SHTML and HTML can be explained in one sentence: SHTML is not HTML but a server API, and SHTML is HTML dynamically generated by the server. Although both are hypertext formats, shtml is a file used for SSI technology. That is Server Side Include--SSI server-side include directive. If the Web Server has SSI function (most (especially Unix-based) WEB servers such as Netscape Enterprise Server support SSI commands). shtml files will be treated specially. First scan the shtml file to see if there are any special SSI instructions now. If there is, the SSI instructions are interpreted according to the Web Server setting rules. After the interpretation, it is sent to the client together with the normal HTML. shtml Use the HTML file extension of SSI (Server Side Include). SSI (Server Side Include), commonly known as "server-side embedding" or "server-side inclusion", is a server-based web page production technology similar to ASP. How SSI works: You can use Server-Side Include (SSI) directives to include text, graphics, or application information into a Web page before sending the content to the browser. For example, you can use SSI to include a time/date stamp, a copyright notice, or a form for the customer to fill out and return. Using include files is an easy way to have text or graphics that appear repeatedly in multiple files. Instead of typing the content into all files, you can put it into an include file. An include file is called with a very simple statement that instructs the Web server to insert the content into the appropriate Web page. Furthermore, when using include files, all changes to the content can be made in just one place. Because files containing SSI directives require special processing, all SSI files must be given the SSI file extension. The default extensions are .stm, .shtm, and .shtml The web server processes SSI directives while processing the web page. When the web server encounters an SSI directive, it directly inserts the contents of the included file into the HTML web page. If an Include File contains SSI directives, this file is also inserted. In addition to the basic directives for including files, you can use SSI directives to insert information about a file (such as its size) or to run an application or shell command. A common problem encountered in website maintenance is that the structure of the website is fixed, but a large number of web pages have to be redone in order to update a little content. SSI provides a simple and effective way to solve this problem. It puts the basic structure of a website in a few simple HTML files (templates). All we have to do later is to upload the text to the server and let the program automatically generate web pages according to the template, making it easy to manage large websites. Therefore, the purpose of pages using SHTML format is similar to ASP, but because it is an API, it runs faster and more efficiently. It is faster than ASP and slower than HTML. However, since server-side includes can be used, page updates are easy (especially batch updates of banners, copyrights, etc.). Imagine that you have a section of HTML and want to insert some special server-side scripts in the middle, such as inserting other HTML paragraphs. You choose ASP to complete this task, but if the task is heavier and takes more time, such as 5 seconds, at this time you do not use ASP but use SHTML, and perhaps the processing time is only 4 seconds. |
<<: Pricing table implemented with CSS3
>>: Detailed explanation of the process of building an MQTT server using Docker
Table of contents 1. let keyword 1.1 Basic Usage ...
Dockerfile is a file used to build a docker image...
For Centos installation of MySQL, please refer to...
Base image The base image has two meanings: Does ...
1. Problem Description root@mysqldb 22:12: [xucl]...
Because I have always used vscode to develop fron...
MySQL bidirectional backup is also called master-...
This article shares the specific code for the WeC...
1. MySQL 1.1 MySQL installation mysql-5.5.27-winx...
Table of contents 1. Document.execCommand() metho...
MySQL dynamically modify replication filters Let ...
What problems does MySQL ROLE solve? If you are a...
MySQL temporary tables are very useful when we ne...
When checking the service daily, when I went to l...
The pop-up has nothing to do with whether your cur...