gzip compression in Windows Azure Websites

后端 未结 2 1655
再見小時候
再見小時候 2020-12-09 18:52

Is it possible to Enable gzip compression on a simple Azure Website? If so how can it be done? Is there anything to take under consideration when applying gzip on Azure Webs

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 19:13

    Per @DavideB's comment on the accepted answer, I found out that you can configure this for Azure / IIS via web.config. [ MSDN source ]

    
      
    
        
          
    
          
            
          
          
            
          
    
        
    
      
    
    

    Please note:

    1. This will only work in Azure, or with IIS with the correct features installed (i.e. if you're using IISExpress, or vanilla IIS you're out of luck, see the article for the correct features, and configuration instructions for local testing).

    2. The compression of Static and Dynamic resources are configured independently, and have separate default values; in practice you should configure your mimetypes and compression levels more carefully than I have.

    3. Compression Level is between 0 and 10, where 0 == off, and 10 == maximum; Here, I've set mine to 7, with the reasoning that it's probably a good trade off between CPU usage and compression.

提交回复
热议问题