Removal of ESI comment tag to allow minify html to work.

Created on 5 February 2025, about 11 hours ago

Problem/Motivation

Reference: https://www.drupal.org/project/minifyhtml/issues/3504535 🐛 Support for Varnish ESI with Advanced Varnish Needs work
Currently, when using a module that allows to strip comments from your html, as for example provided in the minifyhtml module, we are breaking the output of ESI content.

Steps to reproduce

Enable the minifyhtml module and enable the comment stripping.
Enable the adv_varnish module, enable ESI, enable a block to use ESI and request the page from a url that passes varnish, ideally when not logged in.

You will notice that the block using ESI does not output anything.

Proposed resolution

Remove the <!-- esi comments from the module, or allow to disable these.
There is no direct use case to have these comments, as Varnish will replace the ESI element upon loading the page, it should not arrive at the end user.

Remaining tasks

I will create a patch to work around this, needs review.

🐛 Bug report
Status

Needs work

Version

4.0

Component

Code

Created by

🇧🇪Belgium hoebekewim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024