I am trying to implement GZip compression for my asp.net page (including my CSS and JS files). I tried the following code, but it only compresses my .aspx page (found it fro
Add .aspx extension to .css or .js file. Use <%@ Page ContentType="text/css" %> or javascript within the file to serve it with correct MIME type. & use URL Rewrite to hide this from the user agent browsers. The content-encoding response header is appended gzip to convey that gzip is the method used to perform compression. Vary response header's set to Accept-Encoding so all caches know which page (compressed or uncompressed) should be served depends on request's Accept-Encoding header. I've elaborated on this at https://stackoverflow.com/a/14509007/1624169