plone / plone.app.mosaic

Plone Mosaic main repository
https://pypi.python.org/pypi/plone.app.mosaic
GNU General Public License v2.0
35 stars 26 forks source link

Add optional generic ESI transform #101

Open datakurre opened 9 years ago

datakurre commented 9 years ago

Add an optional transform, which (possibly following a policy) transforms elements with data-tile attribute into esi:includes, after the tiles transform. With the default p.a.blocks ESI transform ESI-supporting tiles must be inherited from ESITile base class and esi:include is created by calling the tile with a subrequest. This transform would avoid those subrequests.

@optilude If you have time, would you remember, why the original ESI tile story in plone.app.blocks and plone.tile is based on special ESITile base class and calling those tiles with subrequest? Instead of just transform, which replaces tile tags with esi:include tags?

I see that it allows tile to provide esi:include for both head and body, and also allows ESI-support to be opt-in per each tile. At least the latter, probably both, could be set simply as data-attribute in the tile tag.

optilude commented 9 years ago

I can't remember sorry :) I trust your judgement though.

— Sent from Mailbox

On Mon, Jun 29, 2015 at 6:34 PM, Asko Soukka notifications@github.com wrote:

Add an optional transform, which (possibly following a policy) transforms elements with data-tile attribute into esi:includes, after the tiles transform. With the default p.a.blocks ESI transform ESI-supporting tiles must be inherited from ESITile base class and esi:include is created by calling the tile with a subrequest. This transform would avoid those subrequests. @optilude If you have time, would you remember, why the original ESI tile story in plone.app.blocks and plone.tile is based on special ESITile base class and calling those tiles with subrequest? Instead of just transform, which replaces tile tags with esi:include tags?

I see that it allows tile to provide esi:include for both head and body, and also allows ESI-support to be opt-in per each tile. At least the latter, probably both, could be set simply as data-attribute in the tile tag.

Reply to this email directly or view it on GitHub: https://github.com/plone/plone.app.mosaic/issues/101

datakurre commented 9 years ago

Thanks. I judge that the original implementation is very clever and flexible, and may also be affected by the original design using only XTHML without data-attributes. Yet, I want to optimize my ESI to not require subrequest calls for ESI tiles, so I'll see if a more simple transform is good enough and make that an optional override over the default one.