Apply it to make some public areas of the website into independent pages, and then use this technology to embed them into other pages that require content in this area.
mechanism:
The SSI mechanism is dynamic inclusion, rather than static generation. It is caused by a web server, such as apache, when it receives a user's request, if it parses into an SSI inclusion instruction, it will automatically take out the included page and embed it into the requested page and send it to the user as a whole page. For the user, there is no idea what the server has done, but it just knows to get a complete page.
benefit:
From the SSI working mechanism, we know that the inclusion action occurs every time the user requests the page, so if the content of the included page changes, it can also be reflected in real time. Because of this, it is easy to implement dynamic embedding of static pages. We can use it to realize the public areas of the entire website, or publish a lot of duplicate areas into an independent static page, and then use SSI instructions to include it where needed, such as the head and tail of the entire website, the latest news of the entire website, the hottest rankings, etc. This technology is widely used by most portal websites, such as 163, sina, etc.
How to implement the hottest content:
First configure the SSI environment (refer to other SSI configuration tutorials)
Then create an independent node
Create a new additional publish or article page, bind to the small template that calls the hottest content, and specify a path and file name at the same time
Then publish it into a static html page/hot.html
Then write the following SSI command in the box with the hottest content left on the homepage of the website
<!--#include virtual=/hot.html -->
Change the extension published on the homepage to index.shtml (the default document page of the directory in the server configuration must also be added with the shtml type)
In this way, you can see the effect by using /index.shtml. After adding a bunch of articles every time, you only need to update this hot.html, and you don’t need to update the homepage.
This method can even make all the column list blocks in the homepage into this form. Using the additional publishing function of each node, you can add a small page to publish the content list of this node while publishing the homepage of the column, and then embed it with SSI instructions on the homepage. In the future, just update the column content and column additional publishing page, and the homepage does not need to be refreshed at any time!