我正在使用PageSpeed Insights在我的asp.net应用程序中进行页面优化,并且发现我需要将所有请求压缩为Gzip格式以减小大小和加载时间 .
但是,当我在网络中检查了请求时,它显示我在 Request-header & Response-Header 中已经分别有 Accept-Encoding:gzip,deflate,sdch 和 Content-Encoding:gzip . 这意味着aspx页面会自动进行编码!
How this was happened? Is it by default?
对于js和css,没有编码,并且在 PageSpeed Insights 中它向我显示您需要压缩所有 js 和 css 以及高优先级部分 . How can i achieve it for my asp.net application?
1 回答
IIS能够为您执行gzip压缩,下面的示例进入您的web.config