Azure Web App Not Using GZip Compression

后端 未结 2 457
南旧
南旧 2020-12-03 15:52

I was using WebPageTest to test the performance of my Azure Web App (ASP.Net vNext Web API/Angular). I got an F for both \"Compress Transfer\" and \"Cache Static Content\".<

2条回答
  •  天命终不由人
    2020-12-03 16:32

    Just to back up @theadriangreen here - it will be a header problem. I've found adding the types in the web.config to be unreliable.

    What you need to do instead is edit the applicationHost.config file stored in the deepest dark part of azure. The easiest way to do this, is to install the IIS Manager extension either in the Azure portal or in Kudu. Kudu can be accessed via .scm.azurewebsites.net.

    There you can edit the file, and it'll save a xdt for you - which once you restart the app you should find that the xdt gets applied.

    Alternatively, you can just add an applicationHost.xdt to your App root and you are good to go. Here is a sample.

    
    
      
        
          
            
          
        
      
    
    

    References:-

    • https://github.com/projectkudu/kudu/wiki/Xdt-transform-samples
    • https://blogs.msdn.microsoft.com/benjaminperkins/2015/03/03/making-changes-to-the-applicationhost-config-on-azure-websites/
    • https://github.com/shibayan/IISManager

提交回复
热议问题