Dynamic Static generation Html File I. Why do I generate a static page?
Static webpage generationHtmlFile generation has many advantages, suchHtmlWeb pages can be indexed by search engines,Improve website awareness. At the same time, data access is reduced, database access is reduced, and web pages are opened more quickly.
Ii. How to implement it? 1 , Direct read/write
Direct useIoSetHtmlCodeWrite to the file and generate. HtmlFormat File.
Disadvantage: It is difficult to modify a large amount of code.
2 , Template
The second method is to use the template technology to replace the values of special codes in the template with values accepted from form or database fields to complete the template function; generate all the final replaced template codeHtmlFile. This technology is widely used.,MostCMSThis method is used.
Advantage: reduces the amount of code; disadvantage: Suitable for modifying webpages with few content, such as information, only the title, content, and source.
3 , XMLHTTP
The third method is to useXMLHTTPObtainHtmlContent, ReuseADODB. StreamOrScripting. FileSystemObjectOr save the snapshot technologyHtmlFile.
Advantage: When a dynamic web page is generated, it is savedHtmlIs a by-product of the server. Disadvantage: the application scope is small.
4 , XSL , XML File
The fourth method is to useXSLFile. All formats are defined in this file.ProgramNot processedHtmlAny element in the file. SetXSLFile andXMLFile match to generateHtmlFile.
Advantage: the program does not process anyHtmlElements, easy to modify. Disadvantages:XSLRatioHtmlComplicated production.
Iii. Summary
There are many ways to generate static Web pages. The second method is the most used. I personally think the fourth method is not bad. Each method has advantages and disadvantages and determines the method based on the actual situation. I hope you will give more comments and see what other methods are available.
Mao's nest