Compression of bundles created by asp.net bundling using 'System.Web.Optimization'?

我的梦境 提交于 2021-02-07 16:42:47

问题


I have created bundles in my asp.net web solution by using the new bundling and minification package by MS. Everything is properly bundled and minified (used global.asax way) but when I deploy on IIS the bundle is not getting compressed (gzip) , I don't want to enable dynamic compression (as it will compress all dynamic content), just want to compress bundles only.

What to do ?

What is the mime type of a bundled output, like for this bundle named 'Jquery' here :

"http://Myhost/MySite/JQuery?v=1Oof3SDB0npBNcnfiEpdM9WovwwmP-UGKz3QrSQLPPQ1"

So I can add the same in webconfig file in httpCompression section for gzip compression.

Regards, Gaurav


回答1:


I enabled dynamic compression in IIS7, there is not other way to compress bundles like this other than enabling dynamic compression, although it is advised that you implement this only if you are using IIS7 or above, dynamic compression in lower versions is not optimized and will tax your server.

Running my solution on production after implementing this without any issues.



来源:https://stackoverflow.com/questions/18895536/compression-of-bundles-created-by-asp-net-bundling-using-system-web-optimizatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!