设为首页 收藏本站
查看: 577|回复: 0

[经验分享] HTTP Compression

[复制链接]

尚未签到

发表于 2015-8-16 09:19:45 | 显示全部楼层 |阅读模式
HTTP Compression - .NET vs IIS/ISAPI


Many major sites such as Google, Amazon and eBay all have one thing in common - they use HTTP Compression extensively both to speed up page download times and save on bandwidth.

If you are using IIS and want to benefit from web compression then you have a number of options available. You can use the IIS built-in compression filter (available in IIS 5.0 and improved in IIS 6.0) or any one of several other commercial ISAPI filters:

http://www.pipeboost.com/
http://www.httpzip.com/
http://www.xcache.com/

If you are using ASP.NET then you can of course use our ASPAccelerator.NET component or HttpCompress.

As you can guess, they are all pretty similar in that fundamentally they do the same thing (reduce page output size using HTTP compression) but there are significant differences depending on whether you go for a .NET approach or an ISAPI one. So which one should you go for and why?

ISAPI filters work at the IIS level which means that they can act on any request made to the web server. An ISAPI compression filter can typically compress static site content such as HTML files as well as dynamic application output. A .NET module on the other hand can only process requests that are handled by the ASP.NET engine.

Installing an ISAPI filter requires administrator permissions and console access to the web-server. Enabling HTTP Compression in IIS is normally something that the server administrator would do and requires changes to the IIS MetaBase. Adding a .NET module is much easier and can still be done by the administrator at the server-level by changing the machine.config file but also by the application developer / web author by including the assembly and changing the web.config file.

This is perhaps the biggest difference between the two - HTTP Compression deployment and configuration is part of your application so is usable on shared hosting without any admin/console access and configuration can be made to suit your app (eg. different compression levels may be appropriate for different pages).

This makes the .NET solutions much more appropriate for application developers who want to build HTTP Compression into their application whereas the IIS/ISAPI approach is targeted more towards server administrators.

In terms of performance there are a lot of factors involved. Our own .NET solution was significantly faster than the IIS 5.0 ISAPI filter but since Microsoft put a lot of work into optimising the compression filter for IIS 6.0 the difference is now negligable. For many situations the .NET solution can still be faster though.

Because ASPAccelerator.NET is a .NET Module and runs as part of your ASP.NET application it is aware of ASP.NET Output Caching and so can avoid re-compressing already compressed pages which can make a big difference to CPU usage on a busy server. IIS doesn't know whether the page output has just been generated or is the same cached version that has been served out 1,000 times before - it re-compresses the dynamic output again each time.

If you are interested in HTTP Compression then you are likely to be interested in performance and are probably already using or looking at ASP.NET Output Caching. If so, I'd recommend comparing the compression performance of .NET and ISAPI solutions with Output Caching is used.  One other thing worth mentioning is configuration. Whether a particular request can be compressed or not depends on features of the request. While IIS allows some configuration the level of control available is not as powerful as the rules-engine that we use for ASPAccelerator.NET which allows complete control over the content negotiation process.
  Finally, while the ISAPI solutions can compress output of web-services (if configured correctly) the client cannot by default uncompress these. We provide additional helper classes that enables HTTP Compression support to web-service clients. This works at the protocol level so the same classes can be used whatever compression solution is being used on the server.
  In addition, we also include WSE 2.0 filters to add compression to SOAP packets. This enables compression of SOAP requests going both from and to the server and would, for instance, allow DIME attachments being uploaded to the server to be compressed (the WSE filter needs to be added to the client and the server and is a proprietary extension).
  Whatever the traffic on your site, or the solution that suits you best, I'd recommend you giving HTTP Compression a try - it provides real ROI (if your bandwidth bill is large enough or you are on the limit with your hosting allowance) and avoids having slow downloads that some users may not be willing to wait for.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-99601-1-1.html 上篇帖子: IIS(IISReset.exe)命令行(备忘) 下篇帖子: iis的远程管理与安全
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表