SharePoint 网站模板的效率真的不如网站定义吗?

发布于 2024-07-14 17:23:14 字数 1185 浏览 7 评论 0原文

因此,在 SharePoint 博客圈中,似乎每个人都只是从其他博客复制并粘贴相同的要点。 我看到的一个要点是,SharePoint 网站模板的效率低于网站定义,因为网站定义存储在文件系统上。 真的吗?

网站模板的效率较低似乎很奇怪。 据我了解,所有网站内容都位于数据库中,无论您使用网站模板还是网站定义。 网站模板一旦应用到数据库,从那时起,网站就不应该关心内容是否是使用网站模板创建的。

那么,网站模板的效率低于网站定义的架构原因是什么?


编辑:指向表示存在性能差异的博客的链接:

至少,我认为上述文章并不完整,而且根据我对 SharePoint 架构的了解,我认为其中几篇文章具有误导性。

我读了另一篇博客文章,反对性能差异,但我找不到链接。

So, it seems in the SharePoint blogosphere that everybody just copies and pastes the same bullet points from other blogs. One bullet point I've seen is that SharePoint site templates are less efficient than site definitions because site definitions are stored on the file system. Is that true?

It seems odd that site templates would be less efficient. It's my understanding that all site content lives in a database, whether you use a site template or a site definition. A site template is applied once to the database, and from then on the site should not care if the content was created using a site template or not.

So, what is an architectural reason why a site template would be less efficient than a site definition?


Edit: Links to the blogs that say there is a performance difference:

  • From MSDN: Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance.
  • From DevX: However, user templates in SharePoint can lead to performance problems and may not be the best approach if you're trying to create a set of reusable templates for an entire organization.
  • From IT Footprint: Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. Templates in the database are compiled and executed every time a page is rendered.
  • From Branding SharePoint:Custom site definitions hold the following advantages over custom templates:
    • Data is stored directly on the Web servers, so performance is typically better.

At a minimum, I think the above articles are incomplete, and I think several are misleading based on what I know of SharePoint's architecture.

I read another blog post that argued against the performance differences, but I can't find the link.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

余罪 2024-07-21 17:23:14

使用网站模板与网站定义的性能影响通常被夸大了。

为什么?

好吧,让我们举个例子:

  1. 您采用了一个团队站点站点定义。
  2. 您将其另存为新的站点模板,
  3. 然后基于此新站点模板创建一个新的子网站。

你有什么? 好吧,要记住的重要一点是“重影”发生在页面级别,而不是站点级别。 由于您没有自定义任何页面,因此您访问的任何页面仍然直接来自站点定义,直接来自文件系统。

想要证明这一点,这里有两个测试:

第一个测试

  1. 尝试修改原始站点定义中的default.aspx页面。
  2. 检查您的网站模板,注意您看到了修改。
  3. 它仍然“幻影”到文件系统

第二次测试

  1. 创建一个新的站点定义。
  2. 基于此新站点定义创建一个新站点。
  3. 创建新网站模板
  4. 将网站模板发送给 SharePoint 合作伙伴,并要求他们基于该模板创建新的子网站。

它会失败。 为什么? 因为他们的机器上不存在站点定义。

那么,回到您的问题:“SharePoint 网站模板的性能真的不如网站定义吗?” 我的回答是:“在您决定使用网站定义或网站模板时,不应考虑性能因素,而应考虑您的功能目标”。 现在它引起了争议,但对我来说,很少有理由选择站点定义而不是创建功能。

就“鬼魂”而言。 是的,定制后您的页面将存储在数据库中,是的,您将必须进行数据库往返才能获取它。 但是,SharePoint 很智能,当然会缓存此内容。 所以,从理论上讲,是的,它的速度较慢,但​​实际上,没有人真正注意到。

重影自 2003 年以来就已经出现在该产品中(可能在那之前就出现在 STS 中,不记得了),我从未见过关于它对性能影响的官方指南,也没有人在“它速度较慢”的评论之外进行猜测。

这让我相信,这并不是真正值得担心的。 “幽灵”页面更大的担忧是维护它们所带来的困难,但是,对于 2007 和母版页来说,这是一个小得多的问题。

The performance impact of using Site Templates versus Site Definitions is generally overstated.

Why?

Well, lets take this example:

  1. You take a Team Site site definition.
  2. You save it as a new Site Template
  3. You then create a new sub web based on this new site template.

What have you got? Well, the important thing to remember is that "Ghosting" happens at the PAGE level, NOT at the SITE level. Since you have not customised ANY pages, then any pages you access are still coming directly from the Site Definition, directly from the filesystem.

Want to prove it, here are two tests:

First Test

  1. Try modifying the default.aspx page in the original Site Definition.
  2. Check your site template, notice you see the modification.
  3. Its still "Ghosted" to the filesystem

Second Test

  1. Create a new site definition.
  2. Create a new site based on this new Site Definition.
  3. Create a new Site Template
  4. Send the site template to a mate with SharePoint and ask them to create a new subweb based on it.

It will fail. Why? Because the Site Definition does not exist on their machine.

So, to get back to your question, "Are SharePoint site templates really less performant than site definitions?" my answer would be: "Performance considerations should not play a role in your decision to use a Site Definition or a Site Template, the functional objective you have should be". Now it get controversial, but for me, there are very very few reasons to opt for a Site Definition over creating Features.

As far as "Ghosting" goes. Yup, when customised your page will be stored in the Database, and yup, you will have to do a database round trip to get it. But, SharePoint, smart that it is, will of course cache this. So, in theory, yup its slower, in practice, no one really notices.

Ghosting has been in the product since 2003 (probably in STS before that, dont remember) and I have never seen official guidance on the performance impact it has, nor anyone speculating beyond the "it is slower" comments.

This leads me to believe that it just isn't really worrying about. The bigger worry with "Ghosted" pages is the difficulty that comes with maintaining them, but then, with 2007 and Masterpages this is a much smaller problem.

终难遇 2024-07-21 17:23:14

消除重影问题与其说是性能问题,不如说是升级问题。

在 SPS2003 中,消除重影有一个性能缺陷。 这些问题中的大部分已在 SharePoint 2007 中得到解决。首先,非幻影页面由 SPVirtualPathProvider 作为非编译页面运行 - 这实际上至少为第一页提供了更快的渲染速度。

消除重影(或定制 - 谁曾认为重命名该术语并切换“un”是个好主意?;-)的真正杀手是当您想要升级以及您的页面、页面布局、母版页时、内容类型等都是定制的。 如果您曾经尝试过通过广泛的自定义对 MOSS 网站进行外观升级,您也会知道在不丢失自定义页面中包含的布局或功能的情况下让所有内容都显示新设计是多么痛苦。


安德斯·拉斯克

The issue with unghosting is not as much a performance issue as an upgrade issue.

In SPS2003 unghosting had a performance drawback. Much of these problems was addressed in SharePoint 2007. For one thing, the un-ghosted pages run as no-compile pages by SPVirtualPathProvider -this actually gives a faster rendering at least for the first page.

The real killer with un-ghosting (or customizing -who ever thought it a good idea to both rename the term and also switch the "un"? ;-) is when you want to upgrade, and your pages, page layouts, master pages, content types etc are customized. If you ever tried doing a cosmetic upgrade of a MOSS site with extensive customization, you also know what a pain it is to get everything to show the new design, without loosing the layout or functionality contained in the customized pages.

hth
Anders Rask

内心激荡 2024-07-21 17:23:14

站点定义的性能更高,因为它们缓存在文件系统上,无论模板是否存储在数据库中,并且每次呈现页面时都必须编译和执行。 此外,与基于现有网站模板的模板不同,自定义网站定义是独立升级的。

此博客中很好地概述了其他差异帖子此更新了一个

Site definitions are more performant because they are cached on the file system, whether templates are stored in the database and have to be compiled and executed every time a page is rendered. Also, custom site definitions are upgrade independent, unlike templates, that are based on an existing site template.

There are other differences nicely outlined in this blog post and this updated one.

悲凉≈ 2024-07-21 17:23:14

这里的问题称为重影。 开箱即用的 SharePoint 网站在 SharePoint 网站的 12 个配置单元中存储许多文件(包括母版页和页面布局)。 当对这些文件发出请求时,SharePoint 足够智能来执行磁盘读取操作。

可以对这些页面进行“Un-Ghost”操作。 本质上,创建对存储在 SharePoint 内容数据库而不是文件系统中的页面的修改。 对非幻影页面的请求将导致数据库往返(从数据库中选择、返回文件的字节等)。 这必然会导致大量的额外工作。 当您谈论数百或数千个用户访问该站点时,此数据库往返就成为性能问题。

因此,频繁使用的网站的 SharePoint 自定义网站定义将希望在 Web 服务器文件系统上存储尽可能多的文件(并将......从其他所有内容中缓存出来)。 站点定义不一定存储在文件系统上,但该过程(除了更加复杂之外)可以更好地控制任何自定义项目的存储位置。

两个博客讨论该问题的示例。
http://itfootprint.wordpress.com /2007/04/18/sharepoint-site-template-vs-site-definition/
http://my.advisor.com/doc/17614

The issue here is called Ghosting. An out of the box SharePoint site stores many files (including masterpages and pagelayouts) in the 12 hive of the SharePoint website. When a request is made for these files, SharePoint is smart enough to do a disk read operation.

It is possible to "Un-Ghost" these pages. Essentially, createing a modification to the page that is stored in the SharePoint conent database instead of the file system. A request for an Un-Ghosted page will result in a database round trip (selecting from the database, returning the bytes of the file etc). This necessarily results in a non-trivial amount of extra work. When you are talking about 100's or 1000's of users hitting the site, this database round trip becomes a performance issue.

So a SharePoint custom site definition for a heavily used website will want to store as many files on the web server file system as possible (and cache the .... out of everything else). A site definition is not necessarily stored on the file system, but the process (aside from being way more complex) gives far more control of the storage location of any customised items.

An example of two blogs talking about the issue.
http://itfootprint.wordpress.com/2007/04/18/sharepoint-site-template-vs-site-definition/
http://my.advisor.com/doc/17614

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文