In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the jspXCMS page static how to set up the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this jspXCMS page static how to set up the article will have a harvest, let's take a look at it.
Generating static pages is one of the ways to improve the speed of website access. Static pages do not need to be parsed by servlet containers such as tomcat, and html pages are directly sent to browsers by web servers such as apache or nginx, thus improving the speed of website access and reducing the pressure on the server.
Static pages can be set in the column or in the model. If the column does not set static page-related properties, the static page settings for the corresponding model are read.
Note: if you turn on the static setting in the development environment, you will not find the 404 page when you visit the column page (such as http://localhost:8080/news/)).
This is because the development environment uses spring-boot:run to start, which is an embedded Tomcat startup mode, and does not support welcome-file, that is, visiting / news/ will not automatically return / news/index.html pages, resulting in the page cannot be found.
If you deploy the program directly to Tomcat, you won't have such a problem.
If you want to avoid this problem in the development environment, you can do not select the default document option in the following configuration, so that the generated column page url address is http://localhost:8080/news/index.html, and there will be no problem of not finding the page. But the seo effect of this address is worse than that of http://localhost:8080/news/.
Generation management
Click background Navigation content Management-generate Management to enter the generate Management page.
Generate all HTML: generate all HTML. Columns that are set to enable static will be generated, while those without settings will not be generated. So before clicking generate, set up static.
One button turns on static, one button turns on static: in order to quickly turn on and off static, you can turn on static and turn off static with one click. The static settings of the model will be modified after clicking. When you click Open, you need to click generate all HTML to generate a static page.
Generate the home page HTML and delete the home page HTML: the home page HTML is located in the root directory of the website and can be accessed by entering the domain name directly. If the home page HTML is generated, even if static is turned off, the static home page will be accessed because the page still exists. So here is the ability to manually delete the home page HTML.
Column HTML, document HTML: you can select certain columns or documents to generate HTML. When the amount of data is very large (for example, hundreds of thousands, millions), it is very time-consuming to generate static pages.
Column static page settings
Enter the column modification interface, you can see the static page related settings. If there is no relevant field, you can configure it in the system field of the corresponding model.
Static page settings include column page static page and document page static page, which can be turned on or off respectively.
Path variable:
Column ID: {node_id}
Column code: {node_number}
Document ID: {info_id}
Year: {year}
Month: {month}
Day: {day}
Static column: set the static configuration of the column.
Whether to turn it on or off: you can turn the static column on or off.
File path: the static page path of the column page. Such as / news/ {node_number} / index, where {node_number} may be replaced with a column code, here domestic, with the extension .html, and the resulting static page file is / news/domestic/index.html.
File extension: generally choose .html.
Default document: whether the document is read by default when accessing the directory, if you select Yes, the url of this column will not take the file name, but will directly use the directory as the url. For example, the document path is / news/index extension is .html, choose the default document, then url is / news/, or url is / news/index.html. Only when the file name in the document path is index.html, can you choose to be the default document, otherwise the page will not be accessible, such as the document path is / news/abc extension is .html, this is the default document, then the column url path is / news/, this url obviously cannot access / news/abc.html.
Document page static: sets the static configuration of the document.
Whether to turn it on or off: document static can be turned on or off.
File path: the static page path of a document page. For example, / news/ {node_number} / {info_id}, where {node_number} and {info_id} are replaced with column codes, respectively, and the resulting static page file may be / news/domestic/123.html.
File extension: generally choose .html.
Static mode: when adding articles, the system will decide whether to automatically generate or update static files according to the settings here. Note: this setting only applies to new articles. Previously typed articles need to be generated manually at the content Management-Generation Management Office.
Manual generation: after adding an article, the system will not automatically generate static pages, it needs to be generated manually.
Automatically generate document pages: after adding articles, the system will automatically generate document static pages.
Automatically generate document pages and column pages
Automatically generate document page, column page, parent column page, home page
Automatically generate document page, column page, parent column page, home page, column list page
Static pages: refers to the number of pages on the column list page. When the amount of data is large, the list page usually has many pages, if there are 10,000 pieces of data, 20 pieces per page, there will be 500 pages. If you add one document at a time, that is, a static page that triggers an update of 500 pages, it will take a lot of time. At this point, you can set the number of static pages. If you automatically trigger the generation of list pages, it is recommended that the number of static pages be 1 page, not more than 3 pages. After setting the number of static pages, the first n pages are static addresses and the last n pages are dynamic addresses. Since visitors to list pages usually only visit the first three pages, this method is the most reasonable solution to the problem of time consuming to access data and generate static pages.
Model static page settings
Column static fields that are not set, or automatically read the static settings of the corresponding model. In the case of more columns, in order to avoid the heavy work of each column setting, we can directly set static in the model.
Click modify Model at system Administration-Model Management-column Model or Home Model. The model static setting has the same meaning as the column static setting, but because the model static setting works on all corresponding columns, the file path must use variables, such as column file path / {node_number} / index. If you don't use a variable such as / news/index, then all columns use this path, which obviously doesn't work.
Note: any static page settings will not be generated until you click generate manually, and static pages will not be generated automatically after setting. However, after the setup is complete, the new articles can automatically generate static pages without having to generate them manually again.
Static page save location
Many people will ask where the static page is saved. Static pages and images have a feature of static resources, that is, do not need to be processed by the program, what the access path is, what the file path is. If an image access path is / upload/abc.jpg, few people may ask where the image is saved, but static pages are the same.
Where is the static file of the home page saved? Since it can be accessed as the home page, it must be saved in the root directory of the application, and it is impossible to access it elsewhere. The file name is usually also index.html. For example, if the program is deployed in the c:/tomcat/webapps/ROOT directory, the static page of the home page is in c:/tomcat/webapps/ROOT/index.html.
The static file save locations for column pages and detail pages are related to the file path settings described earlier. For example, if the program is deployed in the c:/tomcat/webapps/ROOT directory and the static page path of the column is set to / news/index extension .html, then the url path of this column may be http://localhost:8080/news/index.html (default document selection No) or http://localhost:8080/news/ (default document selection is), and the file location is c:/tomcat/webapps/ROOT/news/index.html.
This is the end of the article on "how to set up jspXCMS pages statically". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to set up jspXCMS pages statically". If you want to learn more knowledge, you are welcome to follow the industry information channel.
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: 281
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.