Forum Themes:
Welcome !

 Web Application HTTP Compression (Gzip / deflate)

Author Message
Samuel

  • Total Posts : 11857
  • Reward points : 180790
  • Joined: May 23 '01
  • Status: offline
Web Application HTTP Compression (Gzip / deflate) Wed. Nov 12, '08 2:32 AM (permalink)
NOTE: This trick is unsupported, but currently working fine on our online demo.

NOTE: Only use this trick when you cannot use the HTTP Compression feature supported by IIS 6 & 7.

IIS 6 HTTP Compression | IIS 7 HTTP Compression



If your host does not allow HTTP Compression supported on IIS 6 / 7 (can greatly save you bandwidth), you can enable HTTP Compression for the forum software to save bandwidth by following the steps below:

Instruction to enable HTTP Compression for your forum


First, download the attached file below, unzip, and upload the content onto your forum's ~/bin folder.
This dll set is modified by me to suit our software (faster and more efficient). The original compression dll can be found here (not compatible with the software though).

Second, open the web.config file under your forum root, and make the following changes:

  1. If you are using IIS 6 or IIS7 Classic Mode:

    under system.web > httpModules, add

    <add name="HttpCompressModule" type="DC.Web.HttpCompress.HttpModule,DC.Web.HttpCompress" />


    under system.web > httpHandlers, add

     
         <add verb="*" path="css.axd" type="DC.Web.HttpCompress.CompressionHandler,DC.Web.HttpCompress" />        
         <add verb="*" path="js.axd" type="DC.Web.HttpCompress.CompressionHandler,DC.Web.HttpCompress" />  
         
  2. If you are using the IIS 7 Integrated Mode:

    under system.webServer > modules, add

    <add name="HttpCompressModule" preCondition="integratedMode" type="DC.Web.HttpCompress.HttpModule,DC.Web.HttpCompress" />


    under system.webServer > handlers, add

     
         <add name="HttpCompressionCss" preCondition="integratedMode" verb="*" path="*css.axd" type="DC.Web.HttpCompress.CompressionHandler,DC.Web.HttpCompress" />        
         <add name="HttpCompressionJs" preCondition="integratedMode" verb="*" path="*js.axd" type="DC.Web.HttpCompress.CompressionHandler,DC.Web.HttpCompress" />  
         
  3. under configSections (near the top of the web.config file), add

             
                 <sectionGroup name="DCWeb"> 
                     <section name="HttpCompress" type="DC.Web.HttpCompress.Configuration, DC.Web.HttpCompress" requirePermission="false" /> 
                 </sectionGroup> 
         


  4. Right below configSections, add:

     
             <DCWeb> 
                 <HttpCompress compressionType="GZip"> 
                     <IncludedMimeTypes> 
                         <add mime="text/html" /> 
                     </IncludedMimeTypes> 
                     <!--<ExcludedMimeTypes> 
                         <add mime="text/html" /> 
                       </ExcludedMimeTypes>--> 
                     <ExcludedPaths> 
                         <add path="~/RadControls/Editor/Localization.aspx" /> 
                     </ExcludedPaths> 
                 </HttpCompress> 
             </DCWeb> 
         
  5. Save web.config to your server.

How does the above technique enhance the performance of the forum?


The above instruction accomplishes 2 things:
  1. Gzip compress aspx pages
  2. Gzip compress, Minify, and combine application JS files and Theme CSS files to save HTTP round trips

Both of the above will greatly save your bandwidth usage and lower network latency, which translates into better performance in most cases.

However, do note that the CPU usage will increase slightly because of the additional file processing this technique requires. So, if you have enough processing power (this is generally the case) but don't have much bandwidth to spare, this is a good trade off to gain noticeable performance.

_
<message edited by Samuel on Thu. Jan 15, '09 3:36 PM>
Attachment(s)DCCompress.zip (26.69 KB) - downloaded 1634 times
ASPPlayground.NET
~ see our Version 4 plans here

 
#1
    Samuel

    • Total Posts : 11857
    • Reward points : 180790
    • Joined: May 23 '01
    • Status: offline
    Re:Web Application HTTP Compression (Gzip / deflate) Thu. Jan 15, '09 12:17 AM (permalink)
    If you downloaded this software before Jan 15, 2008, please download again and replace the files with the new ones in the zip.

    I modified the source to support the Medium Trust environment (most hosting solution), as well as fixing an issue in the original dll.
    ASPPlayground.NET
    ~ see our Version 4 plans here

     
    #2
      Samuel

      • Total Posts : 11857
      • Reward points : 180790
      • Joined: May 23 '01
      • Status: offline
      Re:Web Application HTTP Compression (Gzip / deflate) Wed. Jan 21, '09 11:43 AM (permalink)
      This dll is update again today (Jan, 20, 2009) to fix some caching issue. Please download it again and use the files here to replace the ones on your server.
      ASPPlayground.NET
      ~ see our Version 4 plans here

       
      #3
        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9