Search code examples
c#asp.netorchardcms

Getting random symbols crash page on Asp.net orchard site


Getting some random symbols in return when I load some pages of my website since uploaded to a shared host. It's quite random, normally after navigating to other pages a few times

(��Y�r۸������Q���XR�8�;��vf���DB`P�ry����/�sR�d�I������ ������a�>x����oo_�)

I used Orchard CMS (Asp.net mvc) to build the site. After installing the Combinator module the error stoped happening in chrome but still happens in firefox.


Solution

  • This looks like response is being encoded into gzip twice. Reason why it would do that is because OutputCache module is caching response that is already gzipped and then when it serves that cache IIS will gzip that response once again.

    You can see if that is the case by refreshing your erroring pages in Firefox or Chrome with CTRL + SHIFT + R, does this help with the problem?

    If yes then your hosting has tweaked configs and set compression before cache, you'll need to disable that. In the root of your website's web.config, add just before </system.webServer>

        <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="false" /> 
    </system.webServer>`
    

    dynamicCompressionBeforeCache is false by default that's why it bugs only when deployed to server that has this attribute changed.

    If this doesn't help you can try turning doDynamicCompression to false or disabling OutputCache module.