Monday, October 19, 2015

Web Site Performance Compression

                  

When we talk about web site compression. we are actually referring to HTTP compression.

HTTP Compression : Is a capability that can be built into web servers and web clients to improve transfer speed and bandwidth utilization.
  • Http data is compressed before it is actually sent from the server
  • Compliant browsers will announce what method are supported before downloading the correct format





















  • Browsers that do not support compliant compression method would actually download uncompressed data
  • Additional CPU is used on both server and browser to compress and uncompress the content. Bytes saved over the network make this trade worthwhile. Usually we have CPU available on both end.
















The most common compression scheme include GZIP, Deflate






Enable IIS to compress content

The server handles 2 types of compression
Static Content --> html, javascript and css
                             By default this is checked.

Note:1)  IIS has a threshold of no of times the file has to be requested in a given period of time before it would compress the file. By default it is 2 times within a 10 sec period. Reason to save CPU time.   

If the files are requested frequently then it might not compress the file

         2) IIS would only compress a file over a specific size


Dynamic Content --> Aspx, Cshtml, JSON 



  •      Need to install dynamic compression module in IIS . We can use platform installer
  How to check if Dynamic Content compression is enabled?





C:\Windows\System32\inetsrv\config folder where we have IIS configuration file












Note

1):By default no compression is done for JSON and XML. We need to enable it
in the config file








2) We need to make sure that the mime type is supported by the client












Thumb rule for compression:

If it is text based content then we can compress

No comments:

Post a Comment