nginx static technology

    Usually, the normal website process is that the user requests the Tomcat server, gets the dynamic jsp page after data rendering, and returns it to the user. The optimized data may be directly placed in the cache (without accessing the database to improve the user's access speed).

    The static technology is to turn the resources accessed by users into static html pages, for some businesses that have a large number of visits, do not change or change infrequently, such as product detail pages (the data will basically not change after being put on the shelves). The generated static page html is placed on the nginx server (the upper level of Tomcat), and users do not need to access the tomcat server to access the nginx server, and directly get the required pages in the nginx server.

    For example, to generate a product detail page, first generate the html static page of the product through the freemaker technology (static page template) (you can use message middleware here, put the id of the listed product in the message queue, and then monitor the consumption from the product system according to the product id , picture system, etc., get the data, generate html static pages through the freemaker template), and the static pages are stored in the nginx service cluster.

    The disadvantage is that when the quantity of goods reaches a certain level (such as tens of millions)

    1. The memory requirements of the nginx server are too high;

    2. When the template freemaker or data changes, all nginx servers need to be refreshed again, and the workload is heavy.

    The brand new model is written later.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325680754&siteId=291194637