<p>I have an ASP.NET webforms application (3.5 SP1) that I'm working on, and attempting to enable gzip fpr HTML and CSS that comes down the pipe. I'm using <a href="http://www.stardeveloper.com/articles/display.html?article=2007110401&amp;page=1" rel="nofollow noreferrer">this implementation</a> (and tried a few others that hook into Application_BeginRequest), and it seems to be corrupting the external CSS file that the pages use, but intermittently...suddenly all styles will disappear on a page refresh, stay that way for awhile, and then suddenly start working again.</p>

<p>Both IE7 and FF3 exhibit this behavior. When viewing the CSS using the web developer toolbar, it returns jibberish. The cache-control header is coming through as "private," but I don't know enough to figure out if that's a contributing factor or not.</p>

<p>Also, this is running on the ASP.NET Development Server. Maybe it'd be fine with IIS, but I'm developing on XP and it'd be IIS5.</p>

[{'answer_id': 22563, 'author': 'Sean Carpenter', 'author_id': 729, 'author_profile': 'https://Stackoverflow.com/users/729', 'pm_score': 0, 'selected': False, 'text': "<p>If you will be deploying on IIS 6 or IIS 7, just use the built-in IIS compression.  We're using it on production sites for compressing HTML, CSS, and JavaScript with no errors.  It also caches the compressed version on the server, so the compression hit is only taken once.</p>\n"}, {'answer_id': 22585, 'author': 'travis', 'author_id': 1414, 'author_profile': 'https://Stackoverflow.com/users/1414', 'pm_score': 4, 'selected': True, 'text': '<p>Is it only CSS files that get corrupted? Do JS files (or any other static text files) come through ok?</p>\n\n<p>Also can you duplicate the behavior if you browse directly to the CSS file?</p>\n\n<p>I\'ve only enabled compression on Windows 2003 server\'s IIS using this approach:</p>\n\n<ol>\n<li>IIS → Web Sites → Properties → Service tab, check both boxes</li>\n<li>IIS → Web Service Extensions → Right click, Add New<pre>\n  Name\n      Http Compression \n  Required Files\n      %systemroot%\\system32\\inetsrv\\gzip.dll </pre></li>\n<li>IIS → Right click top node, Internet Information Services, check <em>Enable Direct Metabase Edit</em></li>\n<li>Backup and Edit <code>%systemroot%\\system32\\inetsrv\\MetaBase.xml</code>\n\n<ol>\n<li>Find <code>Location ="/LM/W3SVC/Filters/Compression/gzip"</code>\n\n<ul>\n<li>Add <code>png</code>, <code>css</code>, <code>js</code> and any other static file extensions to <code>HcFileExtensions</code></li>\n<li>Add <code>aspx</code> and any other executable extensions to <code>HcScriptFileExtensions</code></li>\n<li>Save </li>\n</ul></li>\n</ol></li>\n<li>Restart IIS (run <code>iisreset</code>) </li>\n</ol>\n\n<p>If you have a Windows 2003/2008 server to play with you could try that approach.</p>\n'}]
['https://Stackoverflow.com/questions/22509', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1212/']