Home  >  Article  >  Backend Development  >  请教一个数据分页的有关问题

请教一个数据分页的有关问题

WBOY
WBOYOriginal
2016-06-13 12:27:32788browse

请问一个数据分页的问题
比如数据有几万条,分页的话,如果每页50条,共有几千页,每页生成html文件。
每添加一条数据就需要把这几千个html都更新一遍,以保证第一个html是最新的数据。
感觉太浪费,有没有更好的方法?
------解决思路----------------------
这是个静态文件生成策略问题:
如果每次(有新内容时)不是重新生成所有的列表页,而只是重新生成前若干页(比如10页)
这样在新增内容50条后,从原11页起就不需要重新生成了
当然,如果期间翻页到10页之后,可能是要丢失一些资料的,但浏览的数据很多(50*10)短期内看不到也是没关系的
你也可以通过动态页来弥补这个缺失

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn