Link to home
Start Free TrialLog in
Avatar of Wraithbone
WraithboneFlag for Denmark

asked on

IIS7 and dynamic compression of .aspx and .js files

Hello.

I have a setup of 2 web servers with a shared configuration file. (IIS7 on windows 2008 server)

We found out we needed to compress some of our web content and therefore added the compression/dynamic compression features for IIS7.

in our web.config we added this: (see code snippet below)

i checked that the compression part is enabled on both servers and that they sync as they are supposed to.

But with the above config file it compresses everything except the .aspx and .js files as its supposed to. Images, and everything else gets compressed, just not my .aspx/.js files. I even tried adding .aspx as a mime type (i know im not supposed to do this!) just to see if it would get it working. It did not.

Btw i use yslow to test if it compresses the .aspx file. (firefox plug-in)

Anyone have any suggestions ?

EDIT:Added screen shot of the yslow test. Added some text to show the google analytics part. That one is obviously not on my server :) - and don't mind the gzip sizes. your first concern is to just get it working.
<system.webServer>
		<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" />
		<httpProtocol>
			<customHeaders>
				<clear />
				<remove name="X-Powered-By" />
				<add name="ETag" value=" " />
			</customHeaders>
		</httpProtocol>
		<staticContent>
			<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
		</staticContent>
		<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" doDiskSpaceLimiting="true" maxDiskSpaceUsage="2000" minFileSizeForComp="0">
			<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
			<dynamicTypes>
				<add mimeType="text/*" enabled="true" />
				<add mimeType="image/*" enabled="true" />
				<add mimeType="message/*" enabled="true" />
				<add mimeType="application/x-javascript" enabled="true" />
				<remove mimeType="*/*"/>
				<add mimeType="*/*" enabled="true" />
			</dynamicTypes>
			<staticTypes>
				<add mimeType="text/*" enabled="true" />
				<add mimeType="image/*" enabled="true" />
				<add mimeType="message/*" enabled="true" />
				<add mimeType="application/javascript" enabled="true" />
				<remove mimeType="*/*"/>
				<add mimeType="*/*" enabled="true" />
			</staticTypes>
		</httpCompression>
	</system.webServer>

Open in new window

Capture.PNG
ASKER CERTIFIED SOLUTION
Avatar of Wraithbone
Wraithbone
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial