-1

我有一些他们愿意公开和可搜索的用户信息。我在想 ala LinkedIn 这些应该是生成的静态页面,它们驻留在我们的服务器上,具有固定的 URL。

从技术上讲,推荐的方法是什么?

下面是用例:用户表明他在某个帐户(例如 Gymboree)中有联系人。他的用户名是冲锋队。他知道 IT 部门主管和网络运营部门主管。

我想要一个静态的、可搜索的页面,他还可以通过电子邮件将人们发送到该页面,该页面将呈现以下内容:

“stormtrooper”在 Gymboree 知道以下头衔:

  • 信息技术总监
  • 网络总监

"stormtrooper" 需要以下公司的联系人:

  • 签证
  • 威廉姆斯-索诺玛

点击右边的表格联系他,看看你能不能给他一些联系方式。

我希望该页面是搜索“Gymboree”的人可能会偶然发现以帮助他们建立联系的东西,所以我的想法(可能是错误的)是它应该是一个静态页面。会有其他来自类似类型页面的入站链接指向它。

如果他不希望它可搜索,我希望该帐户和用户名对的页面被简单地删除。

4

3 回答 3

2

Your question is a little vague, but PHP can cache dynamically created pages into static ones. A very simplistic system would use output buffering to capture the dynamic contents and write them to a file. You then need to decide how to invalidate this cache (for example, by deleting the static file).

However, you should use caching only when you've encountered a specific performance problem, otherwise it just adds to the complexity of your application needlessly. You can also just cache the underperforming resource (for example database results) instead of the entire page.

If you would elaborate more on what you want to achieve, you'll get a more specific answer.

EDIT: I've reread your modified question. Your approach is incorrect - a person/web crawler requesting the page could not infer from the contents whether it was dynamically generated or not. It could try to guess from the URL format, but those can be controlled by the application. The page can be bookmarked and indexed by search engines just the same.

Caching to actual static files should be used as a optimization when generating those pages on the fly is too expensive.

于 2009-01-10T00:39:55.047 回答
0

If you already have these pages as dynamic content, wget them as HTML and save as static pages somewhere on your server. Serve as usual HTML. Regenerate when necessary. I just don't see a reason why you want to make them static (performance? server security policy? why only these pages?).

于 2009-01-10T00:38:58.713 回答
0

假设您有一个将内容发布到另一个 php 的表单,该表单显示动态结果,但您希望能够与其他人“共享”结果(因此,将动态结果转换为静态页面)。想想 GoogleDocs。这就是我想要做的(以及我是如何找到这个线程的)。那么最好的方法是什么?

于 2009-01-17T01:51:34.223 回答