0

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

Tadej Magajna
  • 2,765
  • 1
  • 25
  • 41
  • It could be that Varnish is confused by the `esi! ` comment handling branch, then removing the wrong part from your page. Does it work with the word `esi` removed? If so, file a bug with Varnish with this testcase. – Martijn Pieters Jun 09 '12 at 09:54
  • FYI I just had a similar problem - if you have a comment in an block the esi:remove isn't hidden when Varnish runs, so you get your content twice if you have an non-ESI fallback. Seems it's any comment, not just something with a match for the string 'esi'… – William Turrell Apr 26 '14 at 22:01

1 Answers1

0

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

Ilmari
  • 177
  • 1
  • 5