ImageProcessor issue: Images not loading and error - Server cannot append header after HTTP headers have been sent.

  • Updated
Description

In some cases the following exception can occur while using ImageProcessor.Web.Episerver. As a result, images will take a very long time to load or do not load at all.

Message    Server cannot append header after HTTP headers have been sent.    
Exception type    System.Web.HttpException   
Failed method    ImageProcessor.Web.HttpModules.ImageProcessingModule.SetHeaders   
Problem Id    System.Web.HttpException at ImageProcessor.Web.HttpModules.ImageProcessingModule.SetHeaders   
Assembly    ImageProcessor.Web, Version=4.10.0.100, Culture=neutral, PublicKeyToken=null   

This can occur when the primary domain is not set correctly or if there is a configuration issue.

Steps
  1. Ensure that the security.config has the following. Within DxP it may be called security-dxc.config.
    <settings>
            <setting key="OnAzure" value="true"/>
    </settings>
  2. Verify that the primary domain is set to the proper URL within the Manage Websites section of the CMS admin. If incorrect, set to the main URL used to load the site.

    2020-04-22_08_47_43-AlloyFind0123_2020_-_Episerver_CMS_11.12.0.0__32_bit_process_.png

    2021-01-26_11_13_17.png

  3. Upgrade ImageProcessor.Web.Episerver to the latest version. 

  4. If the issue continues, check the ImageProcessor.Web.Episerver Github for known issues. If it is a new issue, please report it there. 
    https://github.com/vnbaaij/ImageProcessor.Web.Episerver/issues