« Previous Next »

Thread: Compression of 404 error text

Last post 11-05-2009 2:07 AM by anilr. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 11-04-2009, 11:21 PM

    • SQLRocks
    • Not Ranked
    • Joined on 01-15-2008, 11:56 PM
    • Posts 11

    Compression of 404 error text

    I was looking at the compression of content returned from my IIS7 websites and compressions is generally working well EXCEPT for the case of detailed error messages, such as 404 errors.

    The 404 errors have a content-type of "text/html; charset=utf-8", which is different than most of the content returned by my asp and asp.net pages ("text/html").

     It seemed it might be just as easy as adding another MIMEtype to account for the utf-8 charset, but alas that doesn't seem to be doing it for me. Any ideas of what I need to do to get 404 errors to be sent back compressed?

    Here are the current compression settings I have which are working great for everything except the 404 errors:

            <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
                <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" dynamicCompressionLevel="6" staticCompressionLevel="9" />
                <dynamicTypes>
                    <add mimeType="text/*" enabled="true" />
                    <add mimeType="text/html; charset=utf-8" enabled="true" />
                    <add mimeType="message/*" enabled="true" />
                    <add mimeType="application/x-javascript" enabled="true" />
                    <add mimeType="*/*" enabled="false" />
                </dynamicTypes>
                <staticTypes>
                    <add mimeType="text/*" enabled="true" />
                    <add mimeType="text/html; charset=utf-8" enabled="true" />
                    <add mimeType="message/*" enabled="true" />
                    <add mimeType="application/javascript" enabled="true" />
                    <add mimeType="*/*" enabled="false" />
                </staticTypes>
            </httpCompression>

    Thanks, Phil

  • 11-05-2009, 1:14 AM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: Compression of 404 error text

    IIS only compresses 20X responses. 404 responses won't be compressed by IIS compression modules.

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-05-2009, 2:07 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Compression of 404 error text

    Also, any response less than 2*TCP packet size will not benefit from compression - I haven't checked the exact length of the detailed error response lately, but it should be in that range.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (3 items)
Microsoft Communities