Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Use GZIP files In Asp.net?

I want to use GZIP files to reduce the page load time. I have Converted All my JS files in GZIP files.

Now I want to know How Do I set IIS (I am using IIS 7) that this can be work.

Second thing How do i call GZIP file in My Asp.net Pages as well?

Thanks in Advance

like image 475
Yashwant Kumar Sahu Avatar asked Jan 28 '12 11:01

Yashwant Kumar Sahu


1 Answers

I have Converted All my JS files in GZIP files.

Not necessary. Just enable GZIP compression in IIS settings. This article gives details on how to do so. This SO discussion talks about how to validate that the settings were successfully applied.

Second thing How do i call GZIP file in My Asp.net Pages as well

Compression can be enabled for static and/or dynamic files. ASPX pages are considered a dynamic type; enabling dynamic content compression will cause them to be GZIP'd before they are served to a compatible user agent.

To validate, you can use a tool like http://gtmetrix.com/ which will warn about uncompressed resources.

like image 181
Tim M. Avatar answered Oct 10 '22 11:10

Tim M.