如何让 Http压缩 (GZip) 与 IIS 6 上的 URL 路由(无扩展 URL)配合使用
好的,
URL 路由很棒。 无扩展 URL、SEO 友好等。但是,IIS 6 似乎不会对使用无扩展 URL 的站点执行压缩。
启用通配符映射后,Asp.Net 可以处理无扩展名文件,但是有什么方法可以将这些资源设置为 gzip 压缩吗?
Okay,
URL Routing is great. Extensionless URLS, SEO friendly etc. However, it seems that IIS 6 doesn't perform compression on sites that use Extensionless URLs.
WildCard Mapping is on so Asp.Net can process the extensionless files, but is there any way to set these resources to be gzipped?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许以下产品可能有用: Port80's httpZip
免责声明:我还没有尝试过该产品,并且与该公司没有任何隶属关系。 在我了解到 IIS6 内置的压缩功能并非易事后,我一直在关注这一问题,以防带宽成本飞涨。
httpZip 常见问题解答页面之一指出:
“通过 MIME 类型控制压缩:IIS 6.0 内置压缩使用文件扩展名和/或位置来确定文件是否应该压缩。如果您需要通过 MIME 控制 HTTP 压缩(例如,如果您有一个应用程序) (例如 ASP 或使用不同 MIME 输出内容的 ISAPI 过滤器),httpZip 按 MIME 类型进行压缩的精细控制是在 IIS 6.0 上实现此目的的唯一方法。”
为了解决 JackM 评论中提出的观点,该产品的其中一个声明(在上面的第一个链接中)是“通过实时浏览器兼容性检查确保完美解压。[...然后后来...] Windows Server 2003 上的 IIS 6.0 :Web 服务器中内置了强大的压缩引擎,但存在致命缺陷 - 它缺乏浏览器兼容性检查。”
Perhaps the following product may be useful: Port80's httpZip
Disclaimer: I haven't tried the product, and don't have any affiliation with the company. I've simply been keeping it on my radar in case bandwidth costs ever went through the roof, after I learned IIS6 built in compression wasn't the bees knees.
One of the httpZip FAQ pages states:
"Controlling compression by MIME type: IIS 6.0 built-in compression uses the file extension and/or location to determine whether a file should be compressed or not. If you need to control HTTP compression by MIME (for example, if you have an application file like ASP or an ISAPI filter that is outputting content with different MIMEs), httpZip's granular controls for compression by MIME type are the only way to accomplish this on IIS 6.0."
To address the point raised in JackM's comment, one of the product's claims (at the first link above) is "Flawless decompression ensured by real-time browser compatibility checking. [... then later ...] IIS 6.0 on Windows Server 2003: A robust compression engine is built into the Web server, but suffers from a fatal flaw – it lacks browser compatibility checking."