asp.net-mvccompressionazure-front-door

Compression not working with Azure front door


I have hosted a site and added Azure front door into it. My hosted site is an ASP.NET MVC web application. On the initial load of the site, by clearing cache or for first-time users, most of the files including CSS and js loaded are compressed, but a few js files with query string, in my case the bundle js files are not getting compressed. One of the bundle files is 1.4MB and it loads the exact resource size, hence it takes too much time to load.

I have enabled Caching and compression from the Azure portal. Cant find what I am missing still, Somebody please help. enter image description here

enter image description here

enter image description here


Solution

  • So, finally I found the solution, late to respond here. What I understood is that Azure front door would not cache and compress files which they are not authorized to. So in case of bundle files in MVC applications, we should allow authorization for such files and that can be done from the application web.config file. Here is the code that worked for me. Paste this code inside configuration tag

    <location path="bundles">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>

    Hope this would help you guys.