Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to match static pages with CVM

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to match static pages with CVM. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

In large websites, the pages you often see are basically static pages. Making the page static has many benefits. At present, the main static means are:

(1) one is to grab and save the dynamic page as a static page through the program, which actually exists in the hard disk of the server.

(2) the other way is through the URL Rewrite of the WEB server, its principle is to convert the external URL request into the internal file address according to certain rules through the internal module of the web server, in a word, the static address of the external request is converted into the actual dynamic page address, but the static page actually does not exist. These two methods have achieved the effect of static URL, but each has its own characteristics.

(3) another way is to divide the page into sub-data blocks, each data block may be an inc file, or multiple data blocks may be contained in an inc file. The specific data block partition is processed according to the business structure of the page. For example, common data blocks such as the head and tail of a website can be made into a separate file.

Generate static pages in real time

Use freemarker to generate static pages, the actual existence of pages in the server's hard disk, and then access resources through the nginx reverse proxy server; the method of transforming dynamic pages into actual static pages, due to the existence of static pages, less dynamic parsing process, so improve the page access speed and stability, so the optimization effect is very obvious.

This method is widely used. But its limitations also exist. For large websites, this method will bring problems that can not be ignored.

First, due to the large number of files generated, storage needs to consider the number of files, folders and disk space capacity.

Second, the complexity and heavy workload of page maintenance, as well as the timeliness of page maintenance, require a whole set of site update system.

Although static page access is fast, it is still troublesome to implement, and maintenance is also a troublesome thing. If the site updates quickly, then you need to call the corresponding createHTML method in your background data update section to generate static pages in real time.

If the update speed is not slow, you can update it manually in the background or take advantage of the scheduled task function of the operating system to execute your static page generator.

This is the end of how to match the static page with the CVM. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report