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

  • Updated

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=, Culture=neutral, PublicKeyToken=null   

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

  1. Ensure that the security.config has the following. Within DxP it may be called security-dxc.config.
            <setting key="OnAzure" value="true"/>
  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.



  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.