(7) Nginx configuration example four dynamic and static separation

1. Review of dynamic and static separation

(1) The difference between dynamic pages and static pages

  • Static resource: When the user accesses this resource multiple times, the source code of the resource will never change
  • Dynamic resources: When a user accesses this resource multiple times, the source code of the resource may change

(2) What is dynamic and static separation?

      Nginx dynamic and static separation is simply to separate dynamic and static requests . It cannot be understood as simply physical separation of dynamic and static pages. Strictly speaking, dynamic requests should be separated from static requests, which can be understood as using Nginx to process static pages and Tomcat to process dynamic pages. From the perspective of current implementation, dynamic and static separation can be roughly divided into three types:

  • It is purely to separate static files into separate domain names and put them on separate servers, which is also the current mainstream respected solution;
  • Dynamic and static files are mixed and published, separated by nginx.
  • Pseudo-static: If the website wants to be searched by search engines, the dynamic page static technology freemarker, velocity, themyleaf and other template engine technologies

(3) Why is dynamic and static separation necessary?

  • Static means to change the dynamically generated HTML page into static content and save it. After the user's request comes, you can directly access the static page without rendering through the service. Static HTML pages can be deployed in nginx, which greatly improves concurrency and reduces tomcat pressure.

                                 å¨è¿éæå ¥ å¾çæè¿ °

Guess you like

Origin blog.csdn.net/qq_41893274/article/details/104786442