netlogix / esi-rendering
以esi:include的形式在融合中渲染内容
1.3.0
2022-05-23 15:47 UTC
Requires
- neos/neos: ^5.3 || ^7.3 || ^8.0
Suggests
- flowpack/varnish: For Varnish support including caching ESIs individually with their own lifetime
This package is auto-updated.
Last update: 2024-08-23 22:27:25 UTC
README
此包提供了一种简单的方法在Neos中渲染边缘包含。这允许您单独缓存页面的部分(例如,页眉/页脚)。
我们建议与flowpack/varnish一起使用此包以进行Varnish集成。
安装包
composer require netlogix/esi-rendering
用法
要将融合路径渲染为ESI,您可以使用Netlogix.EsiRendering:RenderAsEsi
Fusion实现
renderer = afx` <p>This is rendered outside of the esi</p> <Netlogix.EsiRendering:RenderAsEsi node={props.site} cacheIdentifier="my-esi"> <p>This is rendered inside of the esi</p> <p>The given node is available as {node}</p> </Netlogix.EsiRendering:RenderAsEsi> `
这将在第一个<p>
标签后渲染一个<esi:include src="...">
标签。
Neos后端不使用ESI,而是直接渲染内容。
调试
要获取ESI URI,可以将以下设置设置为true
Netlogix: EsiRendering: debug: true
这将渲染ESI之前的link
标签
<link rel="esi:include" esi-identifier="my-esi" context-node="/sites/my-site@live" href="/esirendering?fusionPath=...">
默认情况下,此功能在开发上下文中启用。