Arun Rana
Arun Rana

Reputation: 8606

How GZIP compression will take place inside asp.net application?

I was working on page optimization in my asp.net application using PageSpeed Insights and came across that i need to compress all request to Gzip format to reduce size and load time.

However when i have checked requests in network it's shows me that in Request-header & Response-Header there is already Accept-Encoding:gzip,deflate,sdch and Content-Encoding:gzip respectively. That means encoding is automatically take place for aspx page!

How this was happened? Is it by default?

For js and css there is no encoding and in PageSpeed Insights it shows me that you need to compress all js and css as well in High Priority section. How can i achieve it for my asp.net application?

Upvotes: 2

Views: 269

Answers (1)

martin308
martin308

Reputation: 716

IIS is able to do gzip compression for you, example below goes into your web.config

<system.webServer>
    <!-- enable gzip compression -->
    <urlCompression doStaticCompression="true" doDynamicCompression="true" dynamicCompressionBeforeCache="true" />
</system.webServer>

Upvotes: 1

Related Questions