douquan9826 2012-06-27 10:34
浏览 72
已采纳

这些类型的网站的后端如何工作?

I am building my own torrent site and after doing some research I have noticed that a lot of the sites out there including these two:

Most of the pages are static and are not dynamically generated on the fly (as the pages end in .html). Thinking about it, it makes sense to me, as the site would load a lot faster rather than having to go to the database every time the page is loaded by a user.

Would I be correct in assuming the following?

  • The pages are static.

  • The pages are updated frequently.

  • The pages are generated automatically by a programming language like PHP or any other.

Is the reason for doing this to relieve pressure from the database (which must be very large ) and to make the site load faster for its users?

Take these examples below:

I guess the pages must be static, as the hash isn't put in a GET variable, but it rather points to a specific page. You will notice also there are dynamic elements on the page, such as recent searches (right at the bottom) and available comments.

If what I'm thinking is correct. then how does the website(s) handle updating the page for comments? Does it mean that the page has to be updated as a whole everytime someone posts a comment?

  • 写回答

2条回答 默认 最新

  • douxiaochun4964 2012-06-27 10:40
    关注

    File extensions like .html or .php aren't a reliable indicator that they are static pages. It's common practice to use Apache's mod_rewrite (or equivilent) functionality to give dynamic URL's a more user-friendly appearance.

    With large sites like torrentz and bitsnoop, it may also be possible (if not extremely likely) that they are serving static pages - though these static pages will be part of a frequently updated cache.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?