是否可以在 IIS 6 中启用 HTTP 压缩而不重新启动 IIS?

发布于 2024-07-09 11:44:55 字数 477 浏览 9 评论 0原文

我目前正在优化公司网站的性能; 下载 2MB 以上的主页和资源需要 6-10 秒(该网站主要是带有大量媒体的 Flash,因此不是 2MB 的 HTML 和视图状态)。 要降低下载大小,需要做很多事情; 但我绝对想做的一件事是启用 HTTP 压缩来压缩我们的静态内容,特别是 XML、CSS 和 JS; 我认为压缩对于 SWF 和 JPG 不会有太大作用。

我想仅在我们的临时站点上启用此功能,以便我可以进行一些服务器测试和基准测试。 这意味着我必须进行一些元数据库编辑,因为 IIS 6 不允许您通过 IIS 管理器在单个站点上设置压缩。 问题是元数据库被 IIS 锁定,所以我无法保存; 即使我保存了编辑,我也需要重新启动 IIS 才能使更改生效; 这将关闭同一服务器上托管的其他实时站点。 有没有办法在不重新启动 IIS 的情况下为一个站点启用压缩? 我不介意重新启动我们的暂存站点; 我只是不希望这项工作破坏服务器上的其他网站。

非常感谢任何帮助。

I'm currently optimizing the performance on my company's site; when it was taking 6-10 seconds to download 2MB+ of our homepage and assets (the site is mostly Flash with a lot of media, so it's not 2MB of HTML and viewstate). There are a lot of things that will need to be done to get this download size down; but one thing I definitely want to do is enable HTTP compression to compress our static content, specifically XML, CSS, and JS; I don't imagine compression will do much for the SWFs and JPGs.

I want to enable this on just our staging site so I can do some server testing and benchmarking. This means I'm going to have to do some Metabase editing, since IIS 6 doesn't allow you to set compression on an individual site via IIS manager. The problem with that is the Metabase is locked by IIS so I can't save; and even if I save the edits, I'm required to restart IIS for the changes to take affect; which will take down other live sites hosted on the same server. Is there anyway to enable compression for one site without restarting IIS? I don't mind restarting our staging site; I just don't want this work to take down other sites on the server.

Any assistance is greatly appreciated.

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

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

发布评论

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

评论(2

雪化雨蝶 2024-07-16 11:44:55

您是否选中了“启用直接元数据库编辑”? 如果是这样,您应该能够编辑配置数据库,并且在保存文件时 IIS 将自动获取大部分更改。此处有更多详细信息

您还可以使用 adsutil.vbs 启用压缩。 有示例此处和< a href="http://www.codinghorror.com/blog/archives/000059.html" rel="nofollow noreferrer">这篇博文。

cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoStaticCompression False
cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoDynamicCompression False

Do you have "Enable Direct Metabase Edit" checked? If so you should be able to edit the metabase and when the file is save IIS will automatically pickup most of changes.More details here

You can also enable compression using adsutil.vbs. There are examples here and in the comments of this blog post.

cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoStaticCompression False
cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoDynamicCompression False
千寻… 2024-07-16 11:44:55

您确实意识到 IISRESET 可能会在几秒钟内发生,而且速度可能非常快,以至于用户请求只会“挂起”直到服务器响应。

唯一不好的部分是,如果他们使用服务器会话,这些会话可能会丢失。

您应该启用 HTTP 压缩,这通常是一件好事,在当今的服务器中,您很少使用大量的 CPU 使用率,因此压缩 HTTP 输出的小任务将为您节省更多的带宽,而不是损失的 CPU 时间。

我还应该提到,无论谁创建 Flash 文件,都做错了,Flash 开发人员需要流式传输 Flash 组件,而不是交付每一个图形、声音和内容。 第一页视图上的动画。 任何 Flash 首页都没有理由超过 100k。

You do realize an IISRESET can happen in literally a couple seconds, and it can be so quick that user requests will merely "hang" until the server responds.

The only bad part is that if they are using server sessions, those might get lost.

You should enable HTTP compression, it's generally a good thing, in today's servers you are rarely using any significant amount of CPU usage, so the minor task of compressing the HTTP output will save you more on bandwidth than you loose in CPU time.

I should also mention, whoever is creating your Flash files are doing it incorrectly, the flash developer needs to stream the flash components, not deliver every single graphic, sound & animation on the first page view. There's no reason any Flash front page should be more than 100k.

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