Search code examples
varnishhtmlesi

Varnish ESI breaks on html comments


I'm running a drupal site and implementing esi support.

So far it went ok when I implemented the basic esi support on blocks like this:

<esi:include src="blabl"><esi:remove>I am a not yet from esi block <!-- block --> </esi:remove>

Now this worked very good as long there were no html comments inside tags. But when there are html comments inside esi removes only a part of html comments. This results with all following html being commented out and not being displayed

Like this after it's processed by varnish:

I am a block from esi! <!--

Now it would be possible to remove all comments from html, but that doesn't seem like the solution.

Has anyone had similair problems? I'd be very thankful for some help


Solution

  • This is not a self-closing tag (end it with "/>"):

    < esi:include src="blabl">

    The HTML-comment tags were probably read as part of the esi tag.

    < esi:remove>
    

    Only esi:include is supported.

    You should read: https://www.varnish-cache.org/trac/wiki/ESIfeatures