I would like to ask a question about data paging. for example, if there are tens of thousands of data entries and 50 entries on each page, there are thousands of pages, and each page generates an html file.
Each time you add a piece of data, you need to update these thousands of html files to ensure that the first html file is the latest data.
It feels too wasteful. Is there a better way?
Reply to discussion (solution)
Isn't HTML generated on the last page generated every time a piece of data is added? What is your logic .....
The logic is that the latest data is displayed on the first page. The last data record on each page must be moved to the first one on the next page.
I don't think it is possible to generate static pages, use pseudo-static pages, or obtain data asynchronously.
This type of recommendation should not be static. it is best to make it real-time. ajax queries are better, and 50 pieces of data are queried based on paging parameters.
The cms system is what you said. I understand it in this way. although your php generates a column page that consumes resources, however, if users have 100 million or more users, the efficiency is also high. they do not occupy your php system, but directly access static pages. As a result, it is better to have more users. if there are fewer users, they are still directly pseudo-static. Our company's information website now uses the method you mentioned. every time you edit an article, you have to generate it all, but the website is not stuck at all.
Isn't HTML generated on the last page generated every time a piece of data is added? What is your logic .....
I mean, in this case, there will be less than 50 data records on the last page.
This is a static file generation policy problem:
If every time (when there is new content), instead of re-generating all the list pages, just re-generating the previous several pages (such as 10 pages)
In this way, after 50 new content entries are added, you do not need to generate a new one from the original 11 pages.
Of course, some data may be lost after turning pages to 10 pages during the period, but it does not matter if you cannot see a lot of browsing data (50*10) in the short term.
You can also use dynamic pages to make up for this deficiency.
This is a static file generation policy problem:
If every time (when there is new content), instead of re-generating all the list pages, just re-generating the previous several pages (such as 10 pages)
In this way, after 50 new content entries are added, you do not need to generate a new one from the original 11 pages.
Of course, some data may be lost after turning pages to 10 pages during the period, but it does not matter if you cannot see a lot of browsing data (50*10) in the short term.
If this paging policy is used and html is generated on each page, is the number of displayed pages different from that of the html file name?
For example, if there are pages, the first page is directed to page_1000.html, and the second page is directed to page_999.html.
It's no different from what you originally imagined!
Are you asking about static file names?
Rename in the loop in reverse order
It's no different from what you originally imagined!
Are you asking about static file names?
Rename in the loop in reverse order
Okay, use this solution,
Users may wonder why the first page is clicked, and the address bar shows 1000 pages. Ha
Thank you !!!