Turn On HTTP Compression

It’s a good practice to enable HTTP compression for any uncompressed content. Add the following code snippet in web.config.

<system.webServer>
	<!-- GZip static file content. Overrides the server default which only compresses static files over 2700 bytes -->
	<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
		<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
		<staticTypes>
			<add mimeType="text/*" enabled="true" />
			<add mimeType="message/*" enabled="true" />
			<add mimeType="application/javascript" enabled="true" />
			<add mimeType="application/json" enabled="true" />
			<add mimeType="*/*" enabled="false" />
		</staticTypes>
	</httpCompression>
</system.webServer>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s