Umbraco 6 MVC on 1&1 (1and1) shared Windows hosting returns encoding error, appears to be related to gzip

StackOverflow https://stackoverflow.com/questions/17783089

Question

I have a basic MVC site built on Umbraco 6.1.2 and hosted with 1&1 (1and1) using their shared Windows hosting.

The site works perfectly on my local machine but once deployed it throws an encoding error on Firefox, Chrome and IE (other browsers untested, but I assume this will affect all browsers). The back office is accessible and I am able to log in and navigate through the content tree, it is just the rendering of the site content using MVC and Razor which appears to be affected by the problem.

I disabled gzip in Firefox (using this method: http://forgetmenotes.blogspot.co.uk/2009/05/how-to-disable-gzip-compression-in.html) and the website worked as expected, therefore I can only assume that this is an issue with 1&1's gzip configuration.

Has anybody had the same issue? Is it related to Umbracp or has anyone seen the same problem with standard MVC applications?

Was it helpful?

Solution 2

I have found the cause of the problem. I commented out all references to ClientDependency in the Web.config and now my site runs as expected. It seems as though that module is attempting to compress content but failing. This forum post helped locate the issue: http://our.umbraco.org/forum/ourumb-dev-forum/bugs/13525-Client-Dependency-Module-playing-havoc-with-gzip-content-compression

This causes some problems with the core product and is therefore not a fix, it does however give us a starting point for investigations into how the problem can be resolved.

I have updated the Umbraco issue tracker with this information. For those who are interested see here: http://issues.umbraco.org/issue/U4-2203

OTHER TIPS

You should probably enable gzip in your web.config

<system.webServer>
  <httpCompression directory="%SystemDrive%\inetpub\
temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
    <dynamicTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </dynamicTypes>
    <staticTypes>
      <add mimeType="text/*" enabled="true"/>
      <add mimeType="message/*" enabled="true"/>
      <add mimeType="application/javascript" enabled="true"/>
      <add mimeType="*/*" enabled="false"/>
    </staticTypes>
  </httpCompression>
  <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>

There are a few more tricks here Setting the gzip compression in asp.net

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top