Using aspx dynamic page compression you can increase the page download time and user experience as well.  As we know SharePoint serve the page dynamically, hence need to activate the dynamic page compression feature on IIS6 in order to get the good performance boost.  Enabling the dynamic page on IIS your page will load around 7 times faster. HTTP Compression is a feature of IIS v6.  By default, this feature is not turned on.  For general information on HTTP compression, the following document is extremely helpful.

Microsoft TechNet: Using HTTP Compression (IIS 6.0)

Keep in mind that SharePoint renders both static and dynamic files.  Nearly all files rendered from “_layouts” and “_vti_bin” virtual directories are static; however, there are some aspx and asmx pages which exist in those directories.  All files from the root are considered dynamic because content is either served up by either aspx pages or owssvr.dll.  Therefore, when enabling HTTP compression you have the opportunity to utilize both static and dynamic compression.

It’s probably safe to say that most servers can easily handle static compression.  However, enabling dynamic compression requires careful examination of both server hardware capabilities and the content being served.

Instructions

  1. Since we will be modifying the IIS metabase to enable HTTP Compression, it is important to back up the metabase first.
    • Open Internet Information Service Manager.
      Right click on the server node.
    • Click on All Tasks -> Backup/Restore Configuration.
    • Click on Create Backup button.
    • Enter a name for the backup file and click on OK.
    • Click on the Close button to close the Configuration
      Backup/Restore dialog window.
  2. Enable HTTP Compression in IIS per the instructions listed in document listed above.
  3. Specify additional document types for HTTP Compression.
    • When the HTTP Compression is enabled, only the following files are compressed:
      • static files; htm, html and txt
      • dynamic files; asp, dll and exe
    • Open command prompt and change directory to %systemdrive%\inetpub\AdminScripts
    • For static files, run the following two commands:
      • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcFileExtensions “css” “htc” “htm” “html” “js” “txt”
      • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcFileExtensions “css” “htc” “htm” “html” “js” “txt”
    • For dynamic files, run the following two commands:
      • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcScriptFileExtensions “asp” “asmx” “aspx”
      • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions “asp” “asmx” “aspx”Note: The extensions listed in the commands above is a generic list of file extensions used by SharePoint.  Due to the operation behavior of SharePoint, enabling compression of “dll” files may result in performance degradation. Please read the important note in the Things to consider section below as well.
  4. Specify HcDynamicCompressionLevel.
    The range is from 0 to 10. By default, the HcDynamicCompressionLevel is set to 0. Low compression levels produce slightly larger compressed files, but with lower overall impact on CPU and memory resources. Higher compression levels generally result in smaller compressed files but higher CPU and memory usage. Run the following commands to adjust the compression levels:

    • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/GZIP/HcDynamicCompressionLevel “9”
    • CSCRIPT.EXE ADSUTIL.VBS SET W3Svc/Filters/Compression/DEFLATE/HcDynamicCompressionLevel “9”Note: Level 9 offers the best compression without consuming too much processor time.
  5. Apply workaround from KB article 841120.
    This is only necessary if you’ve chosen to include “dll” files for dynamic compression.
  6. Reset IIS service by running IISRESET.EXE in the command prompt.

Things to consider

  • These instructions encompass the majority of file extensions used by SharePoint.  You may find it beneficial to add/remove file extensions depending on your needs and server resources.
  • Dynamic compression consumes server resources with each request.  If you have the processor bandwidth, the opportunity to enable the functionality exists.
  • Even if you have processor bandwidth, it may be helpful to see how dynamic compression impacts your rendering time.  This will require you to compare rendering times with compression both on and off.
  • IMPORTANT: Given that nearly everything coming out of the root virtual directory is processed by owssvr.dll, What is the majority of your content?  Is it zip files, images, other files which can’t be easily compressed or are already compressed?  If so, then enabling dynamic compression may an unnecessary server burden.
  • You can test HTTP compression results with HTTPWatch or Fiddler.

Note: Some threads commented that they are not able to browse the zip file after enabling the HTTP compression, but above approach working like a charm without any issues for us. You can get more information on this thread.

Similar Topics:

Tags:

sharepoint 2010 gzip compressionsharepoint 2010 gzipsharepoint 2010 http compressionGZIP compression sharepoint 2010http compression sharepoint 2010