简体   繁体   English

Varnish ESI在html注释上中断

[英]Varnish ESI breaks on html comments

I'm running a drupal site and implementing esi support. 我正在运行一个drupal网站并实现esi支持。

So far it went ok when I implemented the basic esi support on blocks like this: 到目前为止,当我在这样的块上实现基本的esi支持时,一切正常:

<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. 现在,只要标签内没有html注释,它就可以很好地工作。 But when there are html comments inside esi removes only a part of html comments. 但是,当esi中包含html注释时,只会删除html注释的一部分。 This results with all following html being commented out and not being displayed 结果以下所有html被注释掉而不显示

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. 现在可以从html删除所有注释,但这似乎不是解决方案。

Has anyone had similair problems? 有人遇到过类似问题吗? I'd be very thankful for some help 非常感谢您的帮助

This is not a self-closing tag (end it with "/>"): 这不是自动关闭标签(以“ />”结尾):

< esi:include src="blabl"> <esi:include src =“ blabl”>

The HTML-comment tags were probably read as part of the esi tag. HTML注释标签可能被视为esi标签的一部分。

 < esi:remove> 

Only esi:include is supported. 仅支持esi:include。

You should read: https://www.varnish-cache.org/trac/wiki/ESIfeatures 您应该阅读: https : //www.varnish-cache.org/trac/wiki/ESIfeatures

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM