Try our conversational search powered by Generative AI!

Damaged images when enabling AB testing

Found in

EPiServer.Marketing.Testing 2.5.12

Fixed in

EPiServer.Marketing.Testing 2.6.0

(Or a related package)

Created

Apr 23, 2020

Updated

May 14, 2020

State

Closed, Fixed and tested


Description

Problem

When enabling AB Testing for a home page, images everywhere on the site become broken - with some probability related to "Participation percentage" parameter in home page test.

Affected images are any image - static ones from disk, or static ones from packages (like, background image on login screen from /util path), or images from blobs (media). They are being returned like a binary stream sent with UTF-8 encoding or something similar.
Even the images in the default CMS login screen get broken.

Only images are served through path /episerver/ (in CMS editor) have no problems. Another exception are SVG images, because they're actually XML documents.

Step to Reproduce

We were able to reproduce issue with AB Test package on Alloy Demo sample site (with all episerver.* packages updated to latest versions)

1. In code, add following code into Global.asax.cs:
protected void Application_BeginRequest()

{
    var repository = ServiceLocator.Current.GetInstance<IContentRepository>();
    repository.Get<PageData>(ContentReference.StartPage);
}

2. Start AB Testing on Home page.
3. Flush cache, do a hard refresh on the browser. Images are unable to load.

On Chrome, it won't throw any error, just simply display blank 1x1 images. On Firefox, there'll be errors in browser console.